Merge "Fix 2571606: Correct message after too many failed attempts for password and pin."
This commit is contained in:
committed by
Android (Google) Code Review
commit
a6418d8bc9
@@ -1513,12 +1513,27 @@
|
||||
progress dialog in the meantime. this is the emssage. -->
|
||||
<string name="lockscreen_sim_unlock_progress_dialog_message">Unlocking SIM card\u2026</string>
|
||||
|
||||
<!-- For the unlock screen, Information message shown in dialog when user has too many failed attempts -->
|
||||
<!-- For the unlock screen, Information message shown in dialog when user has too many failed attempts at
|
||||
drawing the unlock pattern -->
|
||||
<string name="lockscreen_too_many_failed_attempts_dialog_message">
|
||||
You have incorrectly drawn your unlock pattern <xliff:g id="number">%d</xliff:g> times.
|
||||
\n\nPlease try again in <xliff:g id="number">%d</xliff:g> seconds.
|
||||
</string>
|
||||
|
||||
<!-- For the unlock screen, Information message shown in dialog when user has too many failed attempts at
|
||||
entering the password -->
|
||||
<string name="lockscreen_too_many_failed_password_attempts_dialog_message">
|
||||
You have incorrectly entered your password <xliff:g id="number">%d</xliff:g> times.
|
||||
\n\nPlease try again in <xliff:g id="number">%d</xliff:g> seconds.
|
||||
</string>
|
||||
|
||||
<!-- For the unlock screen, Information message shown in dialog when user has too many failed attempts at
|
||||
entering the PIN -->
|
||||
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message">
|
||||
You have incorrectly entered your PIN <xliff:g id="number">%d</xliff:g> times.
|
||||
\n\nPlease try again in <xliff:g id="number">%d</xliff:g> seconds.
|
||||
</string>
|
||||
|
||||
<!-- For the unlock screen, Information message shown in dialog when user is almost at the limit
|
||||
where they will be locked out and may have to enter an alternate username/password to unlock the phone -->
|
||||
<string name="lockscreen_failed_attempts_almost_glogin">
|
||||
|
||||
@@ -687,8 +687,17 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
|
||||
|
||||
private void showTimeoutDialog() {
|
||||
int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
|
||||
int messageId = R.string.lockscreen_too_many_failed_attempts_dialog_message;;
|
||||
if(getUnlockMode() == UnlockMode.Password) {
|
||||
if(mLockPatternUtils.getKeyguardStoredPasswordQuality() ==
|
||||
DevicePolicyManager.PASSWORD_QUALITY_NUMERIC) {
|
||||
messageId = R.string.lockscreen_too_many_failed_pin_attempts_dialog_message;
|
||||
} else {
|
||||
messageId = R.string.lockscreen_too_many_failed_password_attempts_dialog_message;
|
||||
}
|
||||
}
|
||||
String message = mContext.getString(
|
||||
R.string.lockscreen_too_many_failed_attempts_dialog_message,
|
||||
messageId,
|
||||
mUpdateMonitor.getFailedAttempts(),
|
||||
timeoutInSeconds);
|
||||
final AlertDialog dialog = new AlertDialog.Builder(mContext)
|
||||
|
||||
@@ -198,7 +198,14 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
|
||||
@Override
|
||||
public void onFinish() {
|
||||
mPasswordEntry.setEnabled(true);
|
||||
mTitle.setText(R.string.keyguard_password_enter_password_code);
|
||||
final int quality = mLockPatternUtils.getKeyguardStoredPasswordQuality();
|
||||
final boolean isAlpha = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC == quality
|
||||
|| DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == quality;
|
||||
if(isAlpha) {
|
||||
mTitle.setText(R.string.keyguard_password_enter_password_code);
|
||||
} else {
|
||||
mTitle.setText(R.string.keyguard_password_enter_pin_password_code);
|
||||
}
|
||||
mKeyboardView.setEnabled(true);
|
||||
}
|
||||
}.start();
|
||||
|
||||
Reference in New Issue
Block a user