Merge "Fix bug where lockout timeout is shown for SIM in keyguard" into klp-dev
This commit is contained in:
@ -82,13 +82,18 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
|
|||||||
|
|
||||||
// if the user is currently locked out, enforce it.
|
// if the user is currently locked out, enforce it.
|
||||||
long deadline = mLockPatternUtils.getLockoutAttemptDeadline();
|
long deadline = mLockPatternUtils.getLockoutAttemptDeadline();
|
||||||
if (deadline != 0) {
|
if (shouldLockout(deadline)) {
|
||||||
handleAttemptLockout(deadline);
|
handleAttemptLockout(deadline);
|
||||||
} else {
|
} else {
|
||||||
resetState();
|
resetState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow subclasses to override this behavior
|
||||||
|
protected boolean shouldLockout(long deadline) {
|
||||||
|
return deadline != 0;
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract int getPasswordTextViewId();
|
protected abstract int getPasswordTextViewId();
|
||||||
protected abstract void resetState();
|
protected abstract void resetState();
|
||||||
|
|
||||||
|
@ -55,6 +55,12 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView
|
|||||||
mPasswordEntry.setEnabled(true);
|
mPasswordEntry.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldLockout(long deadline) {
|
||||||
|
// SIM PIN doesn't have a timed lockout
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPasswordTextViewId() {
|
protected int getPasswordTextViewId() {
|
||||||
return R.id.pinEntry;
|
return R.id.pinEntry;
|
||||||
@ -169,7 +175,7 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView
|
|||||||
@Override
|
@Override
|
||||||
protected void verifyPasswordAndUnlock() {
|
protected void verifyPasswordAndUnlock() {
|
||||||
String entry = mPasswordEntry.getText().toString();
|
String entry = mPasswordEntry.getText().toString();
|
||||||
|
|
||||||
if (entry.length() < 4) {
|
if (entry.length() < 4) {
|
||||||
// otherwise, display a message to the user, and don't submit.
|
// otherwise, display a message to the user, and don't submit.
|
||||||
mSecurityMessageDisplay.setMessage(R.string.kg_invalid_sim_pin_hint, true);
|
mSecurityMessageDisplay.setMessage(R.string.kg_invalid_sim_pin_hint, true);
|
||||||
|
@ -106,6 +106,12 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView
|
|||||||
mPasswordEntry.setEnabled(true);
|
mPasswordEntry.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldLockout(long deadline) {
|
||||||
|
// SIM PUK doesn't have a timed lockout
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPasswordTextViewId() {
|
protected int getPasswordTextViewId() {
|
||||||
return R.id.pinEntry;
|
return R.id.pinEntry;
|
||||||
|
Reference in New Issue
Block a user