summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2012-03-31 16:49:18 -0400
committerrmcc@arcee-kang1 <cyanogenmod@cerqueira.org>2012-04-01 17:56:28 +0100
commit09ee8dd28c6be3d4398f42dfe72d390e29580552 (patch)
tree263e064b5846a951c1b8e98aa72a01bb10ce3663
parentd390193632083a7ca1d5898c2203c0ae1327f33b (diff)
downloadframeworks_base-09ee8dd28c6be3d4398f42dfe72d390e29580552.zip
frameworks_base-09ee8dd28c6be3d4398f42dfe72d390e29580552.tar.gz
frameworks_base-09ee8dd28c6be3d4398f42dfe72d390e29580552.tar.bz2
Quick unlock : Fix bug
There is an issue where users whose passwords are greater than 8 chars and have quick unlock enabled will be unable to unlock their lockscreen. This is due to the logic evaluating anything beyond 3chars as a password attempt. This change modifies the quick unlock behavior so that when typing the password, each character is considered an attempt, however if incorrect, is not reported as a failed attempt. Only when the user presses enter is it considered an "explicit" attempt and a failed attempt is reported. Change-Id: I02d436184d63c6880c7b1dc6b4b6119fba76e9a7
-rw-r--r--policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
index 433c338..76aef9e 100644
--- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java
@@ -129,17 +129,9 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
public boolean onKey(View v, int keyCode, KeyEvent event) {
mCallback.pokeWakelock();
String entry = mPasswordEntry.getText().toString();
- if (keyCode != KeyEvent.KEYCODE_DEL) {
- if (mLockPatternUtils.checkPassword(entry)) {
- mCallback.keyguardDone(true);
- mCallback.reportSuccessfulUnlockAttempt();
- }
- } else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
- mCallback.reportFailedUnlockAttempt();
- if (0 == (mUpdateMonitor.getFailedAttempts() % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
- long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
- handleAttemptLockout(deadline);
- }
+ if (mLockPatternUtils.checkPassword(entry)) {
+ mCallback.keyguardDone(true);
+ mCallback.reportSuccessfulUnlockAttempt();
}
return false;
}