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

Commit b56b3c3c authored by Adrian Roos's avatar Adrian Roos
Browse files

WM: Prevent unminimizing docked stack on AOD

When we go to AOD, we hide Home's app token - which causes
the docked stack to unminimize. There was some protection against
that because the same thing happens on the keyguard, but that did
not work because the keyguard state is not aware of AOD. Instead,
we pipe the source of truth from AM down to WM and use this instead.

Change-Id: I68d1079a6bbd9080816ee52c1b5650623a661421
Fixes: 79267409
Test: Enter split screen, go to home, turn of screen, turn on screen. Verify docked stack stays minimized and there is no janky transition
parent 6d084215
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ class KeyguardController {
        if (showingChanged) {
            dismissDockedStackIfNeeded();
            setKeyguardGoingAway(false);
            mWindowManager.setKeyguardOrAodShowingOnDefaultDisplay(
                    isKeyguardOrAodShowing(DEFAULT_DISPLAY));
            if (keyguardShowing) {
                mDismissalRequested = false;
            }
+1 −1
Original line number Diff line number Diff line
@@ -692,7 +692,7 @@ public class DockedStackDividerController {

        // Do not minimize when dock is already minimized while keyguard is showing and not
        // occluded such as unlocking the screen
        if (mMinimizedDock && mService.mPolicy.isKeyguardShowingAndNotOccluded()) {
        if (mMinimizedDock && mService.mKeyguardOrAodShowingOnDefaultDisplay) {
            return;
        }
        final TaskStack topSecondaryStack = mDisplayContent.getTopStackInWindowingMode(
+9 −0
Original line number Diff line number Diff line
@@ -369,7 +369,10 @@ public class WindowManagerService extends IWindowManager.Stub
    final WindowTracing mWindowTracing;

    final private KeyguardDisableHandler mKeyguardDisableHandler;
    // TODO: eventually unify all keyguard state in a common place instead of having it spread over
    // AM's KeyguardController and the policy's KeyguardServiceDelegate.
    boolean mKeyguardGoingAway;
    boolean mKeyguardOrAodShowingOnDefaultDisplay;
    // VR Vr2d Display Id.
    int mVr2dDisplayId = INVALID_DISPLAY;

@@ -2903,6 +2906,12 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    public void setKeyguardOrAodShowingOnDefaultDisplay(boolean showing) {
        synchronized (mWindowMap) {
            mKeyguardOrAodShowingOnDefaultDisplay = showing;
        }
    }

    // -------------------------------------------------------------
    // Misc IWindowSession methods
    // -------------------------------------------------------------