OSDN Git Service

Fix Password entry won't enable when lockout finished in screen-off
authorlumark <lumark@google.com>
Tue, 24 Sep 2019 09:13:35 +0000 (17:13 +0800)
committerMing-Shin Lu <lumark@google.com>
Tue, 24 Sep 2019 12:48:03 +0000 (12:48 +0000)
CL [1] introduced a check to see if password entry need to show
soft-keyboard for fixing keyboard popup unexpected issue.

But it shouldn't need to block the password entry re-enable when
lockout finished in screen-off state.

Move the original check right before the showSoftInput to fix the case.

[1]: I3c43d09d4206c48f1afcd8dad79e7978337f1b7d

Fix: 128563724
Bug: 112811602
Test: manual as issue steps:
    1). Set up Password as screen lock.
    2). Enter lock screen.
    3). Input wrong password 5 times, and it will show "Try again in 30 seconds" message.
    4). Wait device screen off auto, and then wait 30 seconds.
    5). Screen on device.
    6). Swipe up and then try to input password to unlock, expected password entry
        should enabled and can invoke soft-keyboard.

Change-Id: I3e0eeffdb3536588c0e039c8fbeaf8833e7af06e

packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java

index eaaa3ed..e3ac0f6 100644 (file)
@@ -86,13 +86,12 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
             mSecurityMessageDisplay.setMessage("");
         }
         final boolean wasDisabled = mPasswordEntry.isEnabled();
-        // Don't set enabled password entry & showSoftInput when PasswordEntry is invisible or in
-        // pausing stage.
+        setPasswordEntryEnabled(true);
+        setPasswordEntryInputEnabled(true);
+        // Don't call showSoftInput when PasswordEntry is invisible or in pausing stage.
         if (!mResumed || !mPasswordEntry.isVisibleToUser()) {
             return;
         }
-        setPasswordEntryEnabled(true);
-        setPasswordEntryInputEnabled(true);
         if (wasDisabled) {
             mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
         }