Fixed
Status Update
Comments
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.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.
Description
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManagerImpl.checkStateLoss(FragmentManagerImpl.java:1534)
at androidx.fragment.app.FragmentManagerImpl.enqueueAction(FragmentManagerImpl.java:1556)
at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:591)
at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:543)
at androidx.fragment.app.DialogFragment.dismissInternal(DialogFragment.java:250)
at androidx.fragment.app.DialogFragment.dismiss(DialogFragment.java:202)
at androidx.biometric.FingerprintDialogFragment$2.run(FingerprintDialogFragment.java:360)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:180)
at android.app.ActivityThread.main(ActivityThread.java:6950)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:835)
I would argue that the library should be using the method dismissAllowingStateLoss to dismiss it's dialog because:
1) There is no way for the library implementers to stop this from crashing, even if they call cancelAuthentication() on the biometrics prompt onPause() this error will still happen
2) There is no actual state in the biometrics library that needs to be saved
3) Since this is dismissed with a delay there is no way to guarantee the activity will always be in a good state when it's cleaned up. If the activity gets stopped between the error and the postDelayed there will be a crash
4) A common use case for biometrics is to prevent a user from using the app until they have passed the prompt. This means they will want to have a generic place to launch the biometrics prompt making it very hard to guarantee it's always safe to dismiss the dialog
It's tricky to reproduce so I didn't provide a sample project but it is crashing in our production app. I can probably create one if you still think it's necessary
BUILD INFO
- Device type: SM-G570M, SM-G930F, SM-G930U, ASUS_X00DDB, CPH1819, HTC U11, LG-Q710AL, SM-C710F, SM-C710F, SNE-LX1
- OS version: 8.0.0 and 8.1.0
- Biometric library version: 1.0.0-alpha04
STEPS TO REPRODUCE
If the activity has had onStop called on it before the postDelayed is triggered it will throw an IllegalStateException.
EXPECTED RESULTS
No crash should occur in the library
OBSERVED RESULTS
A crash occurs
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE
I haven't reproduced it myself but it seems to be pretty regularly occurring in our production app.