Fixed
Status Update
Comments
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 164bb50bcabe96a05e80c2d9ce03533e1dc6d26e
Author: Ian Lake <ilake@google.com>
Date: Mon Oct 14 11:03:23 2019
Fix FragmentContainerView inflation with obfuscation
Instead of using a literal for the class name, using
FragmentContainerView.class.getName() to support
obfuscation via ProGuard.
Test: ran testapp with obfuscation
Fixes: 142657034
Change-Id: I9ae40ddb5d3308790d6963f09f3eb110837dbb4c
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
https://android-review.googlesource.com/1142236
https://goto.google.com/android-sha1/164bb50bcabe96a05e80c2d9ce03533e1dc6d26e
Branch: androidx-master-dev
commit 164bb50bcabe96a05e80c2d9ce03533e1dc6d26e
Author: Ian Lake <ilake@google.com>
Date: Mon Oct 14 11:03:23 2019
Fix FragmentContainerView inflation with obfuscation
Instead of using a literal for the class name, using
FragmentContainerView.class.getName() to support
obfuscation via ProGuard.
Test: ran testapp with obfuscation
Fixes: 142657034
Change-Id: I9ae40ddb5d3308790d6963f09f3eb110837dbb4c
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
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.