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

Commit 783729c1 authored by chaviw's avatar chaviw
Browse files

Ensure DockedStackDividerController sets a dim for one stack at a time.

Only set a dim for one stack. If the dimmed stack is already set and
there's a request for dim for another stack, clear the old stack's dim.
This ensures that no old dims are left around with no way to clear them.

Test: Dock an app that can open an IME. Open the IME and then hit home.
There should be no dim layers around when in minimized state.
Fixes: 70894010

Change-Id: I7ddbd4c133acf069f811cf1ead0dd79b0c4118a9
parent d55e3e75
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -568,6 +568,14 @@ public class DockedStackDividerController {
                : null;
        final TaskStack dockedStack = mDisplayContent.getSplitScreenPrimaryStack();
        boolean visibleAndValid = visible && stack != null && dockedStack != null;

        // Ensure an old dim that was shown for the docked stack divider is removed so we don't end
        // up with dim layers that can no longer be removed.
        if (mDimmedStack != null && mDimmedStack != stack) {
            mDimmedStack.stopDimming();
            mDimmedStack = null;
        }

        if (visibleAndValid) {
            mDimmedStack = stack;
            stack.dim(alpha);