Merge "Do not show 2nd FingerprintErrorDialog" into tm-qpr-dev am: 4fd86cc096
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20120050 Change-Id: I68b6a8afeb51b04b1c48cf7e4c94e6e9ff5f346e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -168,7 +168,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
private Vibrator mVibrator;
|
||||
private boolean mIsSetupWizard;
|
||||
private boolean mIsOrientationChanged;
|
||||
private boolean mIsCanceled;
|
||||
@VisibleForTesting
|
||||
boolean mIsCanceled;
|
||||
private AccessibilityManager mAccessibilityManager;
|
||||
private boolean mIsAccessibilityEnabled;
|
||||
private LottieAnimationView mIllustrationLottie;
|
||||
@@ -196,7 +197,7 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
if (hasFocus) {
|
||||
if (hasFocus || mIsCanceled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -411,8 +412,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
|
||||
@VisibleForTesting
|
||||
void onCancelEnrollment(@IdRes int errorMsgId) {
|
||||
FingerprintErrorDialog.showErrorDialog(this, errorMsgId);
|
||||
// showErrorDialog() will cause onWindowFocusChanged(false), set mIsCanceled to false
|
||||
// before showErrorDialog() to prevent that another error dialog is triggered again.
|
||||
mIsCanceled = true;
|
||||
FingerprintErrorDialog.showErrorDialog(this, errorMsgId);
|
||||
mIsOrientationChanged = false;
|
||||
cancelEnrollment();
|
||||
stopIconAnimation();
|
||||
|
@@ -72,6 +72,7 @@ public class FingerprintErrorDialog extends InstrumentedDialogFragment {
|
||||
dialog.dismiss();
|
||||
Activity activity = getActivity();
|
||||
Intent intent = activity.getIntent();
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
intent.putExtra(KEY_STATE_CANCELED, false);
|
||||
activity.startActivity(intent);
|
||||
activity.finish();
|
||||
|
Reference in New Issue
Block a user