Fixed
Status Update
Comments
da...@gmail.com <da...@gmail.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
vi...@google.com <vi...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
da...@gmail.com <da...@gmail.com> #4
The requested info is not needed by your devs.
vi...@google.com <vi...@google.com> #5
Moving the issue to Jetpack (androidx)> Biometric component.
Please check and update this issue.
Please check and update this issue.
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com> #6
This issue is fixed in the androidx.biometric 1.1.0-alpha02 release.
Description
Version used:1.0.1
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: pixel 2 Android 10, Emulator API 27&29
- Relevant code to trigger the issue: equal to the documentation:
and using setDeviceCredentialAllowed(true)
I implemented the new androidx.biometric:biometric:1.0.1 as described in the documentation and using setDeviceCredentialAllowed(true). On API 29 it works correctly, on API < 29 when there aren't any device credentials set I would expect to get ERROR_NO_DEVICE_CREDENTIAL but I'm getting ERROR_USER_CANCELED, is this a library bug or if not what am I missing?
Since the documenation says this library is backwards compatible I would expect I don't need to handle anything myself for API<29, right?
As I could see in BiometricPrompt.java there is a code-block:
case DeviceCredentialHandlerBridge.RESULT_ERROR:
// Device credential auth failed. Assume this is due to the user canceling.
final CharSequence errorMsg = getActivity() != null
? getActivity().getString(R.string.generic_error_user_canceled) : "";
mAuthenticationCallback.onAuthenticationError(
BiometricConstants.ERROR_USER_CANCELED, errorMsg);
bridge.stopIgnoringReset();
bridge.reset();
break;
Don't know why the lib is returning a generic error code in form of ERROR_USER_CANCELED, nothing of this is documented in BiometricConstants.java.