Showing message when max attempts are hit in face unlock fixes b/7306168

Added a check in pattern and PIN to showed the face unlock max attempts
failure message if that had been reached.  The max attempts can only
be true if face unlock is enabled so it doesn't need to also check if it's
enabled.

Change-Id: If8a26498961d79fa6a647abc923c72f0af407e61
This commit is contained in:
Danielle Millett
2012-11-01 15:00:12 -04:00
parent 6e36f1019c
commit 1625e87e60
2 changed files with 15 additions and 3 deletions

View File

@ -42,7 +42,11 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView
}
protected void resetState() {
mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
} else {
mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
}
mPasswordEntry.setEnabled(true);
}

View File

@ -182,7 +182,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
if (deadline != 0) {
handleAttemptLockout(deadline);
} else {
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
displayDefaultSecurityMessage();
}
// the footer depends on how many total attempts the user has failed
@ -197,6 +197,14 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
private void displayDefaultSecurityMessage() {
if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
} else {
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
}
}
@Override
public void showUsabilityHint() {
}
@ -338,7 +346,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
@Override
public void onFinish() {
mLockPatternView.setEnabled(true);
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
displayDefaultSecurityMessage();
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
mFailedPatternAttemptsSinceLastTimeout = 0;
if (mEnableFallback) {