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

Commit 2967f48f authored by Jim Miller's avatar Jim Miller
Browse files

Fix problem where keyguard shows spontaneously

A recent change caused keyguard to ignore the sequence number
when calling doKeyguardLaterLocked().

It also appears we can get into a situation where multiple
requests to show keyguard are pending.  This change ensures
only the latest request gets handled.

Fixes bug 26326350

Change-Id: Ic6cba0054fe235a8838ca8c242b1840c9e8309d6
parent 9317f869
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -474,10 +474,12 @@ public class KeyguardViewMediator extends SystemUI {

    ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {

        @Override
        public void userActivity() {
            KeyguardViewMediator.this.userActivity();
        }

        @Override
        public void keyguardDone(boolean strongAuth) {
            if (!mKeyguardDonePending) {
                KeyguardViewMediator.this.keyguardDone(true /* authenticated */);
@@ -487,6 +489,7 @@ public class KeyguardViewMediator extends SystemUI {
            }
        }

        @Override
        public void keyguardDoneDrawing() {
            mHandler.sendEmptyMessage(KEYGUARD_DONE_DRAWING);
        }
@@ -1248,8 +1251,10 @@ public class KeyguardViewMediator extends SystemUI {
                if (DEBUG) Log.d(TAG, "received DELAYED_KEYGUARD_ACTION with seq = "
                        + sequence + ", mDelayedShowingSequence = " + mDelayedShowingSequence);
                synchronized (KeyguardViewMediator.this) {
                    if (mDelayedShowingSequence == sequence) {
                        doKeyguardLocked(null);
                    }
                }
            } else if (DELAYED_LOCK_PROFILE_ACTION.equals(intent.getAction())) {
                int userId = intent.getIntExtra(Intent.EXTRA_USER_ID, 0);
                if (userId != 0) {
@@ -1698,6 +1703,7 @@ public class KeyguardViewMediator extends SystemUI {
        mHandler.removeMessages(KEYGUARD_DONE_PENDING_TIMEOUT);
    }

    @Override
    public void onBootCompleted() {
        mUpdateMonitor.dispatchBootCompleted();
        synchronized (this) {
+1 −0
Original line number Diff line number Diff line
@@ -6382,6 +6382,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            if (mLockScreenTimerActive != enable) {
                if (enable) {
                    if (localLOGV) Log.v(TAG, "setting lockscreen timer");
                    mHandler.removeCallbacks(mScreenLockTimeout); // remove any pending requests
                    mHandler.postDelayed(mScreenLockTimeout, mLockScreenTimeout);
                } else {
                    if (localLOGV) Log.v(TAG, "clearing lockscreen timer");