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

Commit ad1a7d6e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Assign layers after adding a window"

parents 754be5ce b1b24190
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,9 @@ class WindowToken extends WindowContainer<WindowState> {
        // surface for this token.
        if (mSurfaceControl == null) {
            createSurfaceControl(true /* force */);

            // Layers could have been assigned before the surface was created, update them again
            reassignLayer(getSyncTransaction());
        }
        if (!mChildren.contains(win)) {
            ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", win, this);
+14 −0
Original line number Diff line number Diff line
@@ -93,6 +93,20 @@ public class WindowTokenTests extends WindowTestsBase {
        assertEquals(window1.mToken, window12.mToken);
    }

    @Test
    public void testAddWindow_assignsLayers() {
        final TestWindowToken token1 = createTestWindowToken(0, mDisplayContent);
        final TestWindowToken token2 = createTestWindowToken(0, mDisplayContent);
        final WindowState window1 = createWindow(null, TYPE_STATUS_BAR, token1, "window1");
        final WindowState window2 = createWindow(null, TYPE_STATUS_BAR, token2, "window2");

        token1.addWindow(window1);
        token2.addWindow(window2);

        assertEquals(token1.getLastLayer(), 0);
        assertEquals(token2.getLastLayer(), 1);
    }

    @Test
    public void testChildRemoval() {
        final DisplayContent dc = mDisplayContent;