DO NOT MERGE Fix of crash when error messages are triggered

Issue is caused by call FragmentTransaction.commit after
activity saved it's state, then IllegalStateException will be thrown
and Settings will crash.

Bug: 216492911
Test: Manual. First boot up the device and follow the wizard till the
  point when register the fingerprint. While adding the fingerprint,
  short press the power button and turn off the screen.

Change-Id: I96244fc26d2aa8639538f967d645a6ca4fc7c0ba
Merged-In: I1de23885a9b80fabdc199ad09c35c3f98e86c831
This commit is contained in:
pingzhi wang
2022-01-26 11:27:07 +08:00
committed by Joe Bolinger
parent dac3f891ae
commit d565d8679f

View File

@@ -34,7 +34,7 @@ public class FingerprintErrorDialog extends BiometricErrorDialog {
final CharSequence errMsg = host.getText(getErrorMessage(errMsgId));
final FingerprintErrorDialog dialog = newInstance(errMsg, errMsgId);
final FragmentManager fragmentManager = host.getSupportFragmentManager();
if (!fragmentManager.isDestroyed()) {
if (!fragmentManager.isDestroyed() && !fragmentManager.isStateSaved()) {
dialog.show(fragmentManager, FingerprintErrorDialog.class.getName());
}
}