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

Commit a97eb865 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Partially revert force showing system bar when Bubble is open" into main

parents c8c636ea 75da7672
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();