Skip to content

Commit 29aa5dc

Browse files
author
Jim Miller
committed
Fix 5452698: fix broken logic in reportFailedAttempt() in lockscreen
This fixes a bug where we were no longer showing the countdown dialog every 5 attempts or "forgot pattern" button when the user has a fallback password enabled on the pattern unlock screen. It now correctly shows the dialog whenever the user hits a multiple of 5 bad attempts on any of the pin/pattern/password screens. Change-Id: I4eb47b4149958a93572d256a4a70f9d67bc1eb38
1 parent f129988 commit 29aa5dc

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,20 @@ public void reportFailedUnlockAttempt() {
421421
Slog.i(TAG, "Too many unlock attempts; device will be wiped!");
422422
showWipeDialog(failedAttempts);
423423
}
424-
} else if (usingPattern && mEnableFallback) {
425-
if (failedAttempts == failedAttemptWarning) {
426-
showAlmostAtAccountLoginDialog();
427-
} else if (failedAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET) {
428-
mLockPatternUtils.setPermanentlyLocked(true);
429-
updateScreen(mMode, false);
430-
}
431424
} else {
432-
final boolean showTimeout =
425+
boolean showTimeout =
433426
(failedAttempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) == 0;
427+
if (usingPattern && mEnableFallback) {
428+
if (failedAttempts == failedAttemptWarning) {
429+
showAlmostAtAccountLoginDialog();
430+
showTimeout = false; // don't show both dialogs
431+
} else if (failedAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET) {
432+
mLockPatternUtils.setPermanentlyLocked(true);
433+
updateScreen(mMode, false);
434+
// don't show timeout dialog because we show account unlock screen next
435+
showTimeout = false;
436+
}
437+
}
434438
if (showTimeout) {
435439
showTimeoutDialog();
436440
}

0 commit comments

Comments
 (0)