Fixed
Status Update
Comments
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #2
Thanks for filing the issue.
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
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.