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

Commit 8360a782 authored by Robert Carr's avatar Robert Carr
Browse files

Correct ordering of status bar panel layers.

Not sure what bug was hiding this before but seems pretty clear,
that this is the ordering we need. See the documentation, APPLICATION_PANEL, etc...

Bug: 69591927
Test: Manual
Change-Id: I82fc011aff6122efa5c3ed63da154761e7065612
parent 6f45a394
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -604,8 +604,10 @@ public interface WindowManager extends ViewManager {
        public static final int TYPE_DRAG               = FIRST_SYSTEM_WINDOW+16;

        /**
         * Window type: panel that slides out from under the status bar
         * In multiuser systems shows on all users' windows.
         * Window type: panel that slides out from over the status bar
         * In multiuser systems shows on all users' windows. These windows
         * are displayed on top of the stauts bar and any {@link #TYPE_STATUS_BAR_PANEL}
         * windows.
         * @hide
         */
        public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
+3 −3
Original line number Diff line number Diff line
@@ -808,11 +808,11 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
            case TYPE_INPUT_METHOD_DIALOG:
                // on-screen keyboards and other such input method user interfaces go here.
                return  15;
            case TYPE_STATUS_BAR_SUB_PANEL:
                return  17;
            case TYPE_STATUS_BAR:
                return  18;
                return  17;
            case TYPE_STATUS_BAR_PANEL:
                return  18;
            case TYPE_STATUS_BAR_SUB_PANEL:
                return  19;
            case TYPE_KEYGUARD_DIALOG:
                return  20;
+20 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;

/**
 * Tests for the {@link WindowLayersController} class.
@@ -323,4 +326,21 @@ public class ZOrderingTests extends WindowTestsBase {
        assertWindowLayerGreaterThan(mTransaction, assistantStackWindow, dockedStackWindow);
        assertWindowLayerGreaterThan(mTransaction, pinnedStackWindow, assistantStackWindow);
    }

    @Test
    public void testAssignWindowLayers_ForSysUiPanels() throws Exception {
        final WindowState navBarPanel =
                createWindow(null, TYPE_NAVIGATION_BAR_PANEL, mDisplayContent, "NavBarPanel");
        final WindowState statusBarPanel =
                createWindow(null, TYPE_STATUS_BAR_PANEL, mDisplayContent, "StatusBarPanel");
        final WindowState statusBarSubPanel =
                createWindow(null, TYPE_STATUS_BAR_SUB_PANEL, mDisplayContent, "StatusBarSubPanel");
        mDisplayContent.assignChildLayers(mTransaction);

        // Ime should be above all app windows and below system windows if it is targeting an app
        // window.
        assertWindowLayerGreaterThan(mTransaction, navBarPanel, mNavBarWindow);
        assertWindowLayerGreaterThan(mTransaction, statusBarPanel, mStatusBarWindow);
        assertWindowLayerGreaterThan(mTransaction, statusBarSubPanel, statusBarPanel);
    }
}