Skip to content

Commit 998a504

Browse files
Danielle MillettAndroid (Google) Code Review
authored andcommitted
Merge "Showing message when max attempts are hit in face unlock fixes b/7306168" into jb-mr1-lockscreen-dev
2 parents 0945282 + 1625e87 commit 998a504

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ public KeyguardPINView(Context context, AttributeSet attrs) {
4242
}
4343

4444
protected void resetState() {
45-
mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
45+
if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
46+
mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
47+
} else {
48+
mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
49+
}
4650
mPasswordEntry.setEnabled(true);
4751
}
4852

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void reset() {
182182
if (deadline != 0) {
183183
handleAttemptLockout(deadline);
184184
} else {
185-
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
185+
displayDefaultSecurityMessage();
186186
}
187187

188188
// the footer depends on how many total attempts the user has failed
@@ -197,6 +197,14 @@ public void reset() {
197197

198198
}
199199

200+
private void displayDefaultSecurityMessage() {
201+
if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
202+
mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
203+
} else {
204+
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
205+
}
206+
}
207+
200208
@Override
201209
public void showUsabilityHint() {
202210
}
@@ -338,7 +346,7 @@ public void onTick(long millisUntilFinished) {
338346
@Override
339347
public void onFinish() {
340348
mLockPatternView.setEnabled(true);
341-
mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
349+
displayDefaultSecurityMessage();
342350
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
343351
mFailedPatternAttemptsSinceLastTimeout = 0;
344352
if (mEnableFallback) {

0 commit comments

Comments
 (0)