diff options
author | Steven Ross <stross@google.com> | 2011-11-23 07:54:09 -0500 |
---|---|---|
committer | Steven Ross <stross@google.com> | 2011-11-29 20:49:08 -0500 |
commit | b9430d2a1c8dbf7b9998d349544c9ae133dab18f (patch) | |
tree | 729295ba910ed837467898665cbae363bbb3a15a /policy | |
parent | b468a8fd2b6fba095372afef9272024c9385688d (diff) | |
download | frameworks_base-b9430d2a1c8dbf7b9998d349544c9ae133dab18f.zip frameworks_base-b9430d2a1c8dbf7b9998d349544c9ae133dab18f.tar.gz frameworks_base-b9430d2a1c8dbf7b9998d349544c9ae133dab18f.tar.bz2 |
Display max retry lockout message on backup lock fixes 5462647
Change-Id: I75e51f45f821542ae380e4ec4e3232b3fbe660f4
Diffstat (limited to 'policy')
3 files changed, 17 insertions, 8 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java index ee54de1..dbdfb98 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java @@ -293,6 +293,10 @@ class KeyguardStatusViewManager implements OnClickListener { mUpdateMonitor.registerInfoCallback(mInfoCallback); mUpdateMonitor.registerSimStateCallback(mSimStateCallback); resetStatusInfo(); + //Issue the faceunlock failure message in a centralized place + if (mUpdateMonitor.getMaxFaceUnlockAttemptsReached()) { + setInstructionText(getContext().getString(R.string.faceunlock_multiple_failures)); + } } void resetStatusInfo() { diff --git a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java index b4b82aa..1d6f39a 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java @@ -81,6 +81,8 @@ public class KeyguardUpdateMonitor { private CharSequence mTelephonySpn; private int mFailedAttempts = 0; + private int mFailedFaceUnlockAttempts = 0; + private static final int FAILED_FACE_UNLOCK_ATTEMPTS_BEFORE_BACKUP = 15; private boolean mClockVisible; @@ -630,6 +632,7 @@ public class KeyguardUpdateMonitor { public void clearFailedAttempts() { mFailedAttempts = 0; + mFailedFaceUnlockAttempts = 0; } public void reportFailedAttempt() { @@ -643,4 +646,12 @@ public class KeyguardUpdateMonitor { public int getPhoneState() { return mPhoneState; } + + public void reportFailedFaceUnlockAttempt() { + mFailedFaceUnlockAttempts++; + } + + public boolean getMaxFaceUnlockAttemptsReached() { + return mFailedFaceUnlockAttempts >= FAILED_FACE_UNLOCK_ATTEMPTS_BEFORE_BACKUP; + } } diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index 11da17c..7e48357 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -132,10 +132,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // So the user has a consistent amount of time when brought to the backup method from FaceLock private final int BACKUP_LOCK_TIMEOUT = 5000; - // Needed to keep track of failed FaceUnlock attempts - private int mFailedFaceUnlockAttempts = 0; - private static final int FAILED_FACE_UNLOCK_ATTEMPTS_BEFORE_BACKUP = 15; - /** * The current {@link KeyguardScreen} will use this to communicate back to us. */ @@ -464,7 +460,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler } public void reportSuccessfulUnlockAttempt() { - mFailedFaceUnlockAttempts = 0; mLockPatternUtils.reportSuccessfulPasswordAttempt(); } }; @@ -583,8 +578,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler * FaceLock, but only if we're not dealing with a call */ private void activateFaceLockIfAble() { - final boolean tooManyFaceUnlockTries = - (mFailedFaceUnlockAttempts >= FAILED_FACE_UNLOCK_ATTEMPTS_BEFORE_BACKUP); + final boolean tooManyFaceUnlockTries = mUpdateMonitor.getMaxFaceUnlockAttemptsReached(); final int failedBackupAttempts = mUpdateMonitor.getFailedAttempts(); final boolean backupIsTimedOut = (failedBackupAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT); @@ -1398,7 +1392,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler @Override public void reportFailedAttempt() { if (DEBUG) Log.d(TAG, "FaceLock reportFailedAttempt()"); - mFailedFaceUnlockAttempts++; + mUpdateMonitor.reportFailedFaceUnlockAttempt(); hideFaceLockArea(); // Expose fallback stopFaceLock(); mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT); |