8

When Biometric prompt is shown in App with setDeviceCredentialAllowed(true), It is not dismissed when device home button is pressed. It throws BiometricPrompt.ERROR_USER_CANCELED error and keeps the System UI as is.

Did any one face this issue ? Is there any workaround kind of thing ?

Note : I am using androidx.biometric:biometric:1.0.1

Note: Its Android bug. https://issuetracker.google.com/issues/149770989

Shanker
  • 864
  • 6
  • 24
  • I don't understand why my question is downvoted. It's a kind of undesired behaviour for App user from Android. Error code is returned and dialogue is not dismissed, un dismissed dialogue will not even accept fingerprint and "USE PIN". At least from logs I can say that is a leak. I am blocked on this and expecting some help from SO community. Attempt to invoke virtual method 'void android.content.res.StringBlock.close() on a null object reference at android.content.res.ApkAssets.close(ApkAssets.java:195) at java.lang .Thread.run(Thread.java:919) W/System: A resource failed to call release. – Shanker Feb 19 '20 at 10:24
  • 2
    It's an important question, i'll give you my upvote – Lena Bru Feb 19 '20 at 10:32
  • Also ERROR_USER_CANCELLED can be thrown when you provide the wrong finger or your finger could not be read within 5 attempts of the try. – Lena Bru Feb 19 '20 at 10:33
  • 1
    They are just not handling error number 5 (USER_CANCELLED) Because it can be thrown in multiple scenarios and they only handle the one that user clicks the cancel button – Lena Bru Feb 19 '20 at 10:36
  • 1
    I'm struggling because biometric does not work the same way on samsung galaxy s8/s9/s10 You should check those if you can – Lena Bru Feb 19 '20 at 11:29
  • @LenaBru Thanks again. I will add those testcases. – Shanker Feb 19 '20 at 11:42
  • https://stackoverflow.com/questions/59090310/biometricprompt-iris-and-face-prompt-is-not-working-with-crypto-object-authentic his problem is that face ID is defined on the device – Lena Bru Feb 19 '20 at 11:47

1 Answers1

1

I found this bug when I tried this library. The problem is they implemented it as a fragment, and it's not responding well to this thing.

I opted out of using this library all together and just implemented it myself.

Lena Bru
  • 13,521
  • 11
  • 61
  • 126