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

Commit 75e70282 authored by Yi Jiang's avatar Yi Jiang Committed by Android (Google) Code Review
Browse files

Merge "Clean up flag fix_hide_overlay_api" into main

parents 70636dd7 962effbd
Loading
Loading
Loading
Loading
+12 −23
Original line number Diff line number Diff line
@@ -2162,10 +2162,6 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    private boolean shouldHideNonSystemOverlayWindow(WindowState win) {
        if (!Flags.fixHideOverlayApi()) {
            return !mHidingNonSystemOverlayWindows.isEmpty();
        }

        if (mHidingNonSystemOverlayWindows.isEmpty()) {
            return false;
        }
@@ -9026,7 +9022,6 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        final boolean changed;
        if (Flags.fixHideOverlayApi()) {
        final int uid = win.getOwningUid();
        final int numUIDsPreUpdate = mHidingNonSystemOverlayWindowsCountPerUid.size();
        final int newCount = mHidingNonSystemOverlayWindowsCountPerUid.getOrDefault(uid, 0)
@@ -9041,12 +9036,6 @@ public class WindowManagerService extends IWindowManager.Stub
        // request hiding SAWs changes between "0", "1", or "2+".
        changed = (numUIDsPostUpdate != numUIDsPreUpdate)
                && (numUIDsPostUpdate <= 1 || numUIDsPreUpdate <= 1);
        } else {
            // The visibility of SAWs needs to be refreshed when the number of windows that
            // request hiding SAWs changes between "0" or "1+".
            changed = (effective && mHidingNonSystemOverlayWindows.size() == 1)
                    || (!effective && mHidingNonSystemOverlayWindows.isEmpty());
        }

        if (changed) {
            mRoot.forAllWindows((w) -> {
+0 −3
Original line number Diff line number Diff line
@@ -1412,7 +1412,6 @@ public class WindowManagerServiceTests extends WindowTestsBase {
    }

    @Test
    @EnableFlags(Flags.FLAG_FIX_HIDE_OVERLAY_API)
    public void testUpdateOverlayWindows_singleWindowRequestsHiding_doNotHideOverlayWithSameUid() {
        WindowState overlayWindow = newWindowBuilder("overlay_window",
                TYPE_APPLICATION_OVERLAY).build();
@@ -1432,7 +1431,6 @@ public class WindowManagerServiceTests extends WindowTestsBase {
    }

    @Test
    @EnableFlags(Flags.FLAG_FIX_HIDE_OVERLAY_API)
    public void testUpdateOverlayWindows_multipleWindowsRequestHiding_hideOverlaysWithAnyUids() {
        WindowState overlayWindow = newWindowBuilder("overlay_window",
                TYPE_APPLICATION_OVERLAY).build();
@@ -1464,7 +1462,6 @@ public class WindowManagerServiceTests extends WindowTestsBase {
    }

    @Test
    @EnableFlags(Flags.FLAG_FIX_HIDE_OVERLAY_API)
    public void testUpdateOverlayWindows_multipleWindowsFromSameUid_idempotent() {
        // Deny INTERNAL_SYSTEM_WINDOW permission for WindowSession so that the saw isn't allowed to
        // show despite hideNonSystemOverlayWindows.