diff options
author | Jim Miller <jaggies@google.com> | 2010-03-04 13:24:17 -0800 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2010-03-04 13:26:17 -0800 |
commit | ccd826473701058924fbd3566b84fbe5eb8198e1 (patch) | |
tree | afcefdefccc1a7d2a9f9c640772ce8ab6818dde8 | |
parent | b693873a3b6d39e70fd32abdc8cd5095e3427a2d (diff) | |
download | base-ccd826473701058924fbd3566b84fbe5eb8198e1.tar.gz |
Fix 2420689: Fix bug that prevents pattern unlock from showing lockout dialog.
This fixes the problem where the lockout dialog wasn't showing. It also fixes a problem
where the "forgot pattern" button would stop working.
-rw-r--r-- | phone/com/android/internal/policy/impl/LockPatternKeyguardView.java | 16 | ||||
-rw-r--r-- | phone/com/android/internal/policy/impl/PatternUnlockScreen.java | 9 |
2 files changed, 4 insertions, 21 deletions
diff --git a/phone/com/android/internal/policy/impl/LockPatternKeyguardView.java b/phone/com/android/internal/policy/impl/LockPatternKeyguardView.java index e4f28e9..8bda760 100644 --- a/phone/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/phone/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -290,7 +290,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase // irrelevant to keyguard screen, they shouldn't be calling this } - public void reportFailedPatternAttempt() { + public void reportFailedUnlockAttempt() { mUpdateMonitor.reportFailedAttempt(); final int failedAttempts = mUpdateMonitor.getFailedAttempts(); if (DEBUG) Log.d(TAG, @@ -308,16 +308,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase == 0) { showTimeoutDialog(); } + mLockPatternUtils.reportFailedPasswordAttempt(); } public boolean doesFallbackUnlockScreenExist() { return mEnableFallback; } - public void reportFailedUnlockAttempt() { - mLockPatternUtils.reportFailedPasswordAttempt(); - } - public void reportSuccessfulUnlockAttempt() { mLockPatternUtils.reportSuccessfulPasswordAttempt(); } @@ -330,13 +327,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase setFocusableInTouchMode(true); setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); - // wall paper background - if (false) { - final BitmapDrawable drawable = (BitmapDrawable) context.getWallpaper(); - setBackgroundDrawable( - new FastBitmapDrawable(drawable.getBitmap())); - } - // create both the lock and unlock screen so they are quickly available // when the screen turns on mLockScreen = createLockScreen(); @@ -680,7 +670,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase break; case LockPatternUtils.MODE_PATTERN: // "forgot pattern" button is only available in the pattern mode... - if (mForgotPattern && mLockPatternUtils.isPermanentlyLocked()) { + if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) { currentMode = UnlockMode.Account; } else { currentMode = UnlockMode.Pattern; diff --git a/phone/com/android/internal/policy/impl/PatternUnlockScreen.java b/phone/com/android/internal/policy/impl/PatternUnlockScreen.java index 30fb8b8..d09b358 100644 --- a/phone/com/android/internal/policy/impl/PatternUnlockScreen.java +++ b/phone/com/android/internal/policy/impl/PatternUnlockScreen.java @@ -62,11 +62,6 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient // how many cells the user has to cross before we poke the wakelock private static final int MIN_PATTERN_BEFORE_POKE_WAKELOCK = 2; - // This dictates how long a pattern should be before we count it as an attempt. - // This should be long enough to avoid false triggers while the device is in a pocket, - // as this can lead to a wiped device if a {@link DeviceAdmin} is active and has it enabled. - private static final int MIN_PATTERN_BEFORE_REPORT = 3; - private int mFailedPatternAttemptsSinceLastTimeout = 0; private int mTotalFailedPatternAttempts = 0; private CountDownTimer mCountdownTimer = null; @@ -511,6 +506,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) { mTotalFailedPatternAttempts++; mFailedPatternAttemptsSinceLastTimeout++; + mCallback.reportFailedUnlockAttempt(); } if (mFailedPatternAttemptsSinceLastTimeout >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) { long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); @@ -523,9 +519,6 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient mCancelPatternRunnable, PATTERN_CLEAR_TIMEOUT_MS); } - if (pattern.size() > MIN_PATTERN_BEFORE_REPORT) { - mCallback.reportFailedUnlockAttempt(); - } } } } |