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

Commit 75da7672 authored by Chris Li's avatar Chris Li
Browse files

Partially revert force showing system bar when Bubble is open

The original approach is causing performance regression. Revert to try a
different approach.

Bug: 329124127
Flag: EXEMPT remove flagged code
Test: atest WmTests:InsetsPolicyTest
Change-Id: Iba779707565602aebfb3a567bb38a56f84a2dfe3
parent 52f6df19
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -2636,13 +2636,9 @@ public class DisplayPolicy {
        final boolean inNonFullscreenFreeformMode = freeformRootTaskVisible
                && !topFreeformTask.getBounds().equals(mDisplayContent.getBounds());
        // Always show status/nav bar for non-fullscreen multi window (excluding PiP).
        boolean showSystemBarsByLegacyPolicy = adjacentTasksVisible
        final boolean showSystemBarsByLegacyPolicy = adjacentTasksVisible
                || (DesktopModeFlags.ENABLE_FULLY_IMMERSIVE_IN_DESKTOP.isTrue()
                ? inNonFullscreenFreeformMode : freeformRootTaskVisible);
        if (com.android.window.flags.Flags.forceShowSystemBarForBubble()) {
            showSystemBarsByLegacyPolicy |= defaultTaskDisplayArea.getRootTask(
                    task -> task.isVisible() && task.isNonFullscreenMultiWindow()) != null;
        }

        getInsetsPolicy().updateSystemBars(
                win,
+0 −8
Original line number Diff line number Diff line
@@ -5020,14 +5020,6 @@ class Task extends TaskFragment {
        return mDisplayContent != null && this == mDisplayContent.getFocusedRootTask();
    }

    /** Whether this Task is multi window (exclude PiP) and not filling parent. */
    boolean isNonFullscreenMultiWindow() {
        if (getWindowingMode() == WINDOWING_MODE_PINNED) {
            return false;
        }
        return !fillsParentBounds();
    }

    /**
     * Make sure that all activities that need to be visible in the root task (that is, they
     * currently can be seen by the user) actually are and update their configuration.
+0 −16
Original line number Diff line number Diff line
@@ -158,22 +158,6 @@ public class InsetsPolicyTest extends WindowTestsBase {
        assertNull(controls);
    }

    @Test
    @EnableFlags(Flags.FLAG_FORCE_SHOW_SYSTEM_BAR_FOR_BUBBLE)
    public void testControlsForDispatch_nonFullscreenMultiWindowTaskVisible() {
        addStatusBar();
        addNavigationBar();

        final WindowState win = newWindowBuilder("app", TYPE_APPLICATION).setActivityType(
                ACTIVITY_TYPE_STANDARD).setWindowingMode(WINDOWING_MODE_MULTI_WINDOW).setDisplay(
                mDisplayContent).build();
        win.getTask().setBounds(new Rect(1, 1, 10, 10));
        final InsetsSourceControl[] controls = addWindowAndGetControlsForDispatch(win);

        // The non fullscreen multi window app window must not control any system bars.
        assertNull(controls);
    }

    @Test
    public void testControlsForDispatch_forceStatusBarVisible() {
        addStatusBar().mAttrs.forciblyShownTypes |= statusBars();