Merge "Fix crash when error messages are triggered due to configuration changes." into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
041d8cdb5a
@@ -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