Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d62bfd20 authored by lumark's avatar lumark
Browse files

Fix IME window pops up when unlock keyguard with fingerprint

When in KeyguardPasswordView, hide IME window manually with pressing
back key to back Keyguard view, and then unlock screen with fingerprint
will find IME window pop up suddently.

The reason is when KeyguardBouncer#hide will have a call path to pause
KeyguardPasswordView & reset the state, but in resetState() will call
IMM#showSoftInput even the password entry is invisible.

Make sure to not call IMM#showSoftInput when KeyguardPasswordView is
in pausing stage or password entry is invisible case to prevent
IME pops up in unexpected way.

Bug: 112811602
Test: manual as the issue description
Change-Id: I3c43d09d4206c48f1afcd8dad79e7978337f1b7d
parent 3f215a1d
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
    protected View mEcaView;
    protected View mEcaView;
    protected boolean mEnableHaptics;
    protected boolean mEnableHaptics;
    private boolean mDismissing;
    private boolean mDismissing;
    protected boolean mResumed;
    private CountDownTimer mCountdownTimer = null;
    private CountDownTimer mCountdownTimer = null;


    // To avoid accidental lockout due to events while the device in in the pocket, ignore
    // To avoid accidental lockout due to events while the device in in the pocket, ignore
@@ -263,6 +264,8 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout


    @Override
    @Override
    public void onPause() {
    public void onPause() {
        mResumed = false;

        if (mCountdownTimer != null) {
        if (mCountdownTimer != null) {
            mCountdownTimer.cancel();
            mCountdownTimer.cancel();
            mCountdownTimer = null;
            mCountdownTimer = null;
@@ -276,6 +279,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout


    @Override
    @Override
    public void onResume(int reason) {
    public void onResume(int reason) {
        mResumed = true;
    }
    }


    @Override
    @Override
+5 −0
Original line number Original line Diff line number Diff line
@@ -81,6 +81,11 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
    protected void resetState() {
    protected void resetState() {
        mSecurityMessageDisplay.setMessage("");
        mSecurityMessageDisplay.setMessage("");
        final boolean wasDisabled = mPasswordEntry.isEnabled();
        final boolean wasDisabled = mPasswordEntry.isEnabled();
        // Don't set enabled password entry & showSoftInput when PasswordEntry is invisible or in
        // pausing stage.
        if (!mResumed || !mPasswordEntry.isVisibleToUser()) {
            return;
        }
        setPasswordEntryEnabled(true);
        setPasswordEntryEnabled(true);
        setPasswordEntryInputEnabled(true);
        setPasswordEntryInputEnabled(true);
        if (wasDisabled) {
        if (wasDisabled) {