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

Commit 7d85ea93 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Always tell Keyguard about occluded state

If there was a window with FLAG_DISMISS_KEYGUARD first, when the
device was unlocked, mWinDismissingKeyguard was set to that window.

Now, a window with FLAG_SHOW_WHEN_LOCKED came on top, so we set the
Keyguard as occluded, but we didn't reset the window that is
dismissing Keyguard.

After that, the old window with FLAG_DISMISS_KEYGUARD was the focused
window again. However, since we didn't reset mWinDismissingKeyguard,
we ended up with DISMISS_KEYGUARD_CONTINUE, and lockscreen was not
occluded anymore. However, we never really told Keyguard about it
because DISMISS_KEYGUARD_CONTINUE was set instead of
DISMISS_KEYGUARD_START.

The first fix of this bug is to always tell Keyguard about the
current occluded state. The second fix is to reset
mWinDismissingKeyguard in case a window SHOW_WHEN_LOCKED comes on top.

Bug: 20102975
Change-Id: I7c778df09a1e393b9eeaf51fd2013012cb40fea9
parent eb8f11a8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -4387,21 +4387,21 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
            } else if (mHideLockScreen) {
                mKeyguardHidden = true;
                mWinDismissingKeyguard = null;
                if (setKeyguardOccludedLw(true)) {
                    changes |= FINISH_LAYOUT_REDO_LAYOUT
                            | FINISH_LAYOUT_REDO_CONFIG
                            | FINISH_LAYOUT_REDO_WALLPAPER;
                }
            } else if (mDismissKeyguard != DISMISS_KEYGUARD_NONE) {
                // This is the case of keyguard isSecure() and not mHideLockScreen.
                if (mDismissKeyguard == DISMISS_KEYGUARD_START) {
                    // Only launch the next keyguard unlock window once per window.
                mKeyguardHidden = false;
                if (setKeyguardOccludedLw(false)) {
                    changes |= FINISH_LAYOUT_REDO_LAYOUT
                            | FINISH_LAYOUT_REDO_CONFIG
                            | FINISH_LAYOUT_REDO_WALLPAPER;
                }
                if (mDismissKeyguard == DISMISS_KEYGUARD_START) {
                    // Only launch the next keyguard unlock window once per window.
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {