Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
The problem is that in my app, i have some logic for the BIOMETRIC_ERROR_NONE_ENROLLED case.
On Android 9, this error is not returned when it should be.
BUILD INFO
- Device type: Huawei P20 Lite (ANE-LX1)
- OS version: Android 9 - EMUI 9.1.0
- Biometric library version: 1.1.0 and also 1.2.0-alpha3
STEPS TO REPRODUCE
1. Remove all fingerprints saved but not device credentials
2. Use BiometricManager.from(this).canAuthenticate(BIOMETRIC_STRONG)
EXPECTED RESULTS: 11 (BIOMETRIC_ERROR_NONE_ENROLLED)
OBSERVED RESULTS: -1 (BIOMETRIC_STATUS_UNKNOWN)
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE: 10/10
When you show the BiometricPrompt, the error code returned in the BiometricPrompt.AuthenticationCallback is 11.
When you delete all the fingerprints AND the device credentials, canAuthenticate returns 11.
I saw the source code of BiometricManager, in the method canAuthenticateWithFingerprintOrUnknownBiometric()
// Check for definite availability of fingerprint. Otherwise, return "unknown" to allow for
// non-fingerprint biometrics (e.g. iris) that may be available via BiometricPrompt.
return canAuthenticateWithFingerprint() == BIOMETRIC_SUCCESS
? BIOMETRIC_SUCCESS
: BIOMETRIC_STATUS_UNKNOWN;
canAuthenticateWithFingerprint() returns BIOMETRIC_ERROR_NONE_ENROLLED, but this value is ignored, and all the errors returned are mapped in BIOMETRIC_STATUS_UNKNOWN.
This is for the "iris" biometric authentication, but for this, I'm forced to use the method hasEnrolledFingerprints() of the FingerprintManagerCompat, even if deprecated, to have the correct error.
Isn't there a way to have the BIOMETRIC_ERROR_NONE_ENROLLED error from the "canAuthenticate(BIOMETRIC_STRONG)" method in Android 9?
Thank you for your time.
Regards,
Francesco.