Loading core/res/res/values/strings.xml +3 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <!-- /* //device/apps/common/assets/res/any/strings.xml ** Loading Loading @@ -1787,6 +1787,8 @@ <string name="lockscreen_pattern_wrong">Try again</string> <!-- On the unlock password screen, shown when the user enters the wrong lock password and must try again. --> <string name="lockscreen_password_wrong">Try again</string> <!-- Shown when face unlock failed multiple times so we're just using the backup --> <string name="faceunlock_multiple_failures">Maximum Face Unlock attempts exceeded</string> <!-- When the lock screen is showing and the phone plugged in, and the battery is not fully charged, show the current charge %. --> Loading policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -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() { Loading policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -630,6 +632,7 @@ public class KeyguardUpdateMonitor { public void clearFailedAttempts() { mFailedAttempts = 0; mFailedFaceUnlockAttempts = 0; } public void reportFailedAttempt() { Loading @@ -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; } } policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +2 −8 Original line number Diff line number Diff line Loading @@ -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. */ Loading Loading @@ -464,7 +460,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler } public void reportSuccessfulUnlockAttempt() { mFailedFaceUnlockAttempts = 0; mLockPatternUtils.reportSuccessfulPasswordAttempt(); } }; Loading Loading @@ -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); Loading Loading @@ -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); Loading Loading
core/res/res/values/strings.xml +3 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <!-- /* //device/apps/common/assets/res/any/strings.xml ** Loading Loading @@ -1787,6 +1787,8 @@ <string name="lockscreen_pattern_wrong">Try again</string> <!-- On the unlock password screen, shown when the user enters the wrong lock password and must try again. --> <string name="lockscreen_password_wrong">Try again</string> <!-- Shown when face unlock failed multiple times so we're just using the backup --> <string name="faceunlock_multiple_failures">Maximum Face Unlock attempts exceeded</string> <!-- When the lock screen is showing and the phone plugged in, and the battery is not fully charged, show the current charge %. --> Loading
policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -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() { Loading
policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -630,6 +632,7 @@ public class KeyguardUpdateMonitor { public void clearFailedAttempts() { mFailedAttempts = 0; mFailedFaceUnlockAttempts = 0; } public void reportFailedAttempt() { Loading @@ -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; } }
policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +2 −8 Original line number Diff line number Diff line Loading @@ -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. */ Loading Loading @@ -464,7 +460,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler } public void reportSuccessfulUnlockAttempt() { mFailedFaceUnlockAttempts = 0; mLockPatternUtils.reportSuccessfulPasswordAttempt(); } }; Loading Loading @@ -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); Loading Loading @@ -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); Loading