From d565d8679f5e7f31d978ae4c0f0e2637b1a494f4 Mon Sep 17 00:00:00 2001 From: pingzhi wang Date: Wed, 26 Jan 2022 11:27:07 +0800 Subject: [PATCH] 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 --- .../settings/biometrics/fingerprint/FingerprintErrorDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java b/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java index fa929514173..00c14cab4f8 100644 --- a/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java @@ -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()); } }