diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 63d391a8ee441..0071ea27e65d6 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1513,12 +1513,27 @@ progress dialog in the meantime. this is the emssage. --> Unlocking SIM card\u2026 - + You have incorrectly drawn your unlock pattern %d times. \n\nPlease try again in %d seconds. + + + You have incorrectly entered your password %d times. + \n\nPlease try again in %d seconds. + + + + + You have incorrectly entered your PIN %d times. + \n\nPlease try again in %d seconds. + + diff --git a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java index 27706eff298d7..587f9c19dc3a1 100644 --- a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -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) diff --git a/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java index 8f5bb24ff4b8d..c519d82cb13ff 100644 --- a/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -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();