Fix crash when error messages are triggered due to configuration changes.
Bug: 197265282 Test: Manaul (start enrollment and switch active display) Change-Id: Id83ea58dc6b06461f48cddf90e85cc682ac2451c
This commit is contained in:
@@ -31,13 +31,19 @@ import com.android.settings.biometrics.BiometricErrorDialog;
|
||||
*/
|
||||
public class FingerprintErrorDialog extends BiometricErrorDialog {
|
||||
public static void showErrorDialog(BiometricEnrollBase host, int errMsgId) {
|
||||
if (host.isFinishing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final FragmentManager fragmentManager = host.getSupportFragmentManager();
|
||||
if (fragmentManager.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final CharSequence errMsg = host.getText(getErrorMessage(errMsgId));
|
||||
final FingerprintErrorDialog dialog = newInstance(errMsg, errMsgId);
|
||||
final FragmentManager fragmentManager = host.getSupportFragmentManager();
|
||||
if (!fragmentManager.isDestroyed()) {
|
||||
dialog.show(fragmentManager, FingerprintErrorDialog.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private static int getErrorMessage(int errMsgId) {
|
||||
switch (errMsgId) {
|
||||
|
Reference in New Issue
Block a user