diff options
author | Steve Kondik <shade@chemlab.org> | 2012-02-07 02:11:04 +0300 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-02-07 02:11:04 +0300 |
commit | c4cd0501d2c5a87b83d177101f1ee6799fc34f63 (patch) | |
tree | 6b13a1310f3bcba6e55b447b6703fcfbd1e2d757 /policy | |
parent | 6dbd6dc66849cc706f25e234ec1ad78c9bbc5c63 (diff) | |
parent | ec4c0a8c3f6ce4bd65eb11b91db3b694f6a0542b (diff) | |
download | frameworks_base-c4cd0501d2c5a87b83d177101f1ee6799fc34f63.zip frameworks_base-c4cd0501d2c5a87b83d177101f1ee6799fc34f63.tar.gz frameworks_base-c4cd0501d2c5a87b83d177101f1ee6799fc34f63.tar.bz2 |
Merge "Lockscreen : Quick unlock" into ics
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java index 06cd69e..798add6 100644 --- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -76,6 +76,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private final KeyguardStatusViewManager mStatusViewManager; private final boolean mUseSystemIME = true; // TODO: Make configurable + private boolean mQuickUnlock; private boolean mResuming; // used to prevent poking the wakelock during onResume() // To avoid accidental lockout due to events while the device in in the pocket, ignore @@ -166,6 +167,10 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mCallback.pokeWakelock(); } }); + + mQuickUnlock = (Settings.System.getInt(mContext.getContentResolver(), + Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, 0) == 1); + mPasswordEntry.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { } @@ -177,6 +182,21 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen if (!mResuming) { mCallback.pokeWakelock(); } + if (mQuickUnlock) { + String entry = mPasswordEntry.getText().toString(); + if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { + if (mLockPatternUtils.checkPassword(entry)) { + mCallback.keyguardDone(true); + mCallback.reportSuccessfulUnlockAttempt(); + } else { + mCallback.reportFailedUnlockAttempt(); + if (0 == (mUpdateMonitor.getFailedAttempts() % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { + long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); + handleAttemptLockout(deadline); + } + } + } + } } }); |