0

I implemented the new androidx.biometric:biometric:1.0.1 as described here 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 and if yes where can I report this? or if no 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 the 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 further though.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
David
  • 3,971
  • 1
  • 26
  • 65
  • Can you provide source link of this class? I don't see such code block here https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/hardware/biometrics/BiometricPrompt.java – VVB Feb 01 '20 at 13:13
  • Also, looking at documentation seems like it treats API < 28 same as FingerprintManager. https://developer.android.com/reference/androidx/biometric/BiometricPrompt – VVB Feb 01 '20 at 13:15
  • androidx.biometric.BiometricPrompt line 925 https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/biometric/biometric/src/main/java/androidx/biometric/BiometricPrompt.java – David Feb 03 '20 at 10:52

0 Answers0