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

Commit ce12f851 authored by chaviw's avatar chaviw
Browse files

Don't set relative z of window to IME if starting window

If a window is a starting window, it shouldn't get relative z to IME
since we don't want to change its z order.

Test: Split screen with pip and opening new app in split
Test: WindowStateTests#testNeedsRelativeLayeringToIme_startingWindow
Fixes: 158762203
Change-Id: I0be39285a96bc6458e077b772d0315be6075e0b0
parent 3917b729
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5390,6 +5390,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            final WindowState imeTarget = getDisplayContent().mInputMethodTarget;
            boolean inTokenWithAndAboveImeTarget = imeTarget != null && imeTarget != this
                    && imeTarget.mToken == mToken
                    && mAttrs.type != TYPE_APPLICATION_STARTING
                    && getParent() != null
                    && imeTarget.compareTo(this) <= 0;
            return inTokenWithAndAboveImeTarget;
+10 −0
Original line number Diff line number Diff line
@@ -692,4 +692,14 @@ public class WindowStateTests extends WindowTestsBase {
        sameTokenWindow.removeImmediately();
        assertFalse(sameTokenWindow.needsRelativeLayeringToIme());
    }

    @Test
    public void testNeedsRelativeLayeringToIme_startingWindow() {
        WindowState sameTokenWindow = createWindow(null, TYPE_APPLICATION_STARTING,
                mAppWindow.mToken, "SameTokenWindow");
        mDisplayContent.mInputMethodTarget = mAppWindow;
        sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
                WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
        assertFalse(sameTokenWindow.needsRelativeLayeringToIme());
    }
}