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 | 0340b4299282bcbddd29b26751186431cc4af17b (patch) | |
tree | 777c8e4a2fe2407977191962cc8b74d5295bb203 /policy/com | |
parent | c20115c500ca2ca95b52b3163774e79fc8cc2040 (diff) | |
download | frameworks_base-0340b4299282bcbddd29b26751186431cc4af17b.zip frameworks_base-0340b4299282bcbddd29b26751186431cc4af17b.tar.gz frameworks_base-0340b4299282bcbddd29b26751186431cc4af17b.tar.bz2 |
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.
Diffstat (limited to 'policy/com')
-rw-r--r-- | policy/com/android/internal/policy/impl/LockPatternKeyguardView.java | 16 | ||||
-rw-r--r-- | policy/com/android/internal/policy/impl/PatternUnlockScreen.java | 9 |
2 files changed, 4 insertions, 21 deletions
diff --git a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java index e4f28e9..8bda760 100644 --- a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/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/policy/com/android/internal/policy/impl/PatternUnlockScreen.java b/policy/com/android/internal/policy/impl/PatternUnlockScreen.java index 30fb8b8..d09b358 100644 --- a/policy/com/android/internal/policy/impl/PatternUnlockScreen.java +++ b/policy/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(); - } } } } |