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

Commit dcb93769 authored by Jim Miller's avatar Jim Miller
Browse files

Fix 5027468: prevent screen from turning back on while lockscreen in password mode.

This fixes a bug where LockScreen would turn back on due to the sequence of events
that ultimately cause PasswordUnlockScreen.onResume() to be called when the device powers off.

This is required because the lockscreen rebuilds itself before the screen turns off
so that it's ready to show immediately when the device comes back on.

Change-Id: I86a61cc3b1d77cf7f2a9a198051ea2bbe90607b2
parent 9f845cff
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen

    private StatusView mStatusView;
    private final boolean mUseSystemIME = true; // TODO: Make configurable
    private boolean mResuming; // used to prevent poking the wakelock during onResume()

    // To avoid accidental lockout due to events while the device in in the pocket, ignore
    // any passwords with length less than or equal to this length.
@@ -185,8 +186,10 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
            }

            public void afterTextChanged(Editable s) {
                if (!mResuming) {
                    mCallback.pokeWakelock();
                }
            }
        });
    }

@@ -208,6 +211,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen

    /** {@inheritDoc} */
    public void onResume() {
        mResuming = true;
        // reset status
        mStatusView.resetStatusInfo(mUpdateMonitor, mLockPatternUtils);

@@ -222,6 +226,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
        if (deadline != 0) {
            handleAttemptLockout(deadline);
        }
        mResuming = false;
    }

    /** {@inheritDoc} */