OSDN Git Service

Fix Keyguard PIN error message for N < 4.
authorJim Miller <jaggies@google.com>
Mon, 19 May 2014 18:28:32 +0000 (11:28 -0700)
committerJim Miller <jaggies@google.com>
Mon, 19 May 2014 18:31:08 +0000 (11:31 -0700)
This fixes a bug where no error message was shown
when the user enters less than 4 digits for a PIN.

Fixes bug 14658301

Change-Id: Ia36ad205d197f0eb5f5095d71bc239ec7ded85f2

packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java

index 2d17b7b..aae92e8 100644 (file)
@@ -149,14 +149,16 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
         if (mLockPatternUtils.checkPassword(entry)) {
             mCallback.reportUnlockAttempt(true);
             mCallback.dismiss(true);
-        } else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
-            // to avoid accidental lockout, only count attempts that are long enough to be a
-            // real password. This may require some tweaking.
-            mCallback.reportUnlockAttempt(false);
-            int attempts = KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
-            if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
-                long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
-                handleAttemptLockout(deadline);
+        } else {
+            if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
+                // to avoid accidental lockout, only count attempts that are long enough to be a
+                // real password. This may require some tweaking.
+                mCallback.reportUnlockAttempt(false);
+                int attempts = KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
+                if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
+                    long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
+                    handleAttemptLockout(deadline);
+                }
             }
             mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(), true);
         }