Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com>
em...@gmail.com <em...@gmail.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #3
Steps to reproduce
1. Show the biomterics prompt
2. Use the wrong finger to authenticate several times in a row
Frequency
100% of the time
Expected output
The behavior is the same on all api levels
Current output
The behavior differs between api levels as described in the initial report/video
Android bug report capturing
There's no bugs to capture, this is a behavior difference, not a crash
Attached is a sample apk, all it does is show the biometric prompt using the lib
1. Show the biomterics prompt
2. Use the wrong finger to authenticate several times in a row
Frequency
100% of the time
Expected output
The behavior is the same on all api levels
Current output
The behavior differs between api levels as described in the initial report/video
Android bug report capturing
There's no bugs to capture, this is a behavior difference, not a crash
Attached is a sample apk, all it does is show the biometric prompt using the lib
ob...@gmail.com <ob...@gmail.com> #4
Attached bug reports
Description
Here is the if statement where the decision is made (line 716 of BiometricPrompt)
if (!shouldForceFingerprint && canUseBiometricFragment())
canUseBiometricFragment() only checks if the device is running API 28+ and shouldForceFingerprint is calculated mainly by shouldUseFingerprintforCrypto() . That method iterates through a list of devices that are considered not safe for crypto, all of them seem to be Samsung devices. The issue is that the code goes down the path of “I am running API 28 or grater so I am good to go” . This in turn tries to use the FingerprintManager class to get a string for the error during getErrorString(). This is null for our device since the hardware is not there. Devices that do not pass the if check from above (my Nexus 5 running API 23 for example) use the FingerprintHelperFragment and FingerprintDialogFragment classes to correctly handle not having a hardware sensor.
Here is the stacktrace of the issue:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.hardware.fingerprint.FingerprintManager.getErrorString(int, int)' on a null object reference
at android.hardware.biometrics.BiometricPrompt.lambda$sendError$0(BiometricPrompt.java:490)
at android.hardware.biometrics.-$$Lambda$BiometricPrompt$HqBGXtBUWNc-v8NoHYsj2gLfaRw.run(-.java:6)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6725)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
The code should not use BiometricFragment for this scenario or if it does, BiometricFragment should check internally before using the FingerprintManager. Probably, the best solution is to have the code handle this case to use FingerprintHelperFragment and FingerprintDialogFragment.
library version: androidx.biometric:biometric:1.0.1
device: ATT Radiant (running Android 9.0 Go)