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

Commit 1ff1aedd authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Don't hide overlays created by recents component

Launcher (the recents component) can create critical application overlay
windows like taskbar. It is important the user and apps can't hide them
similar to overlay windows created by sys-ui.

Test: Taskbar isn't hidden when you navigate to settings app.
Bug: 169054709
Change-Id: Id2f20a8e721821299c44641fb9e78980f7d281f4
parent f82f0bc2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
    private final ArraySet<WindowSurfaceController> mAlertWindowSurfaces = new ArraySet<>();
    private final DragDropController mDragDropController;
    final boolean mCanAddInternalSystemWindow;
    // If non-system overlays from this process can be hidden by the user or app using
    // HIDE_NON_SYSTEM_OVERLAY_WINDOWS.
    final boolean mOverlaysCanBeHidden;
    final boolean mCanHideNonSystemOverlayWindows;
    final boolean mCanAcquireSleepToken;
    private AlertWindowNotification mAlertWindowNotification;
@@ -105,6 +108,8 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
                INTERNAL_SYSTEM_WINDOW) == PERMISSION_GRANTED;
        mCanHideNonSystemOverlayWindows = service.mContext.checkCallingOrSelfPermission(
                HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED;
        mOverlaysCanBeHidden = !mCanAddInternalSystemWindow
                && !mService.mAtmInternal.isCallerRecents(mUid);
        mCanAcquireSleepToken = service.mContext.checkCallingOrSelfPermission(DEVICE_POWER)
                == PERMISSION_GRANTED;
        mShowingAlertWindowNotificationAllowed = mService.mShowAlertWindowNotifications;
@@ -534,7 +539,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {

        boolean changed;

        if (!mCanAddInternalSystemWindow) {
        if (mOverlaysCanBeHidden) {
            // We want to track non-system signature apps adding alert windows so we can post an
            // on-going notification for the user to control their visibility.
            if (visible) {
+1 −1
Original line number Diff line number Diff line
@@ -3057,7 +3057,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    }

    void setForceHideNonSystemOverlayWindowIfNeeded(boolean forceHide) {
        if (mOwnerCanAddInternalSystemWindow
        if (!mSession.mOverlaysCanBeHidden
                || (!isSystemAlertWindowType(mAttrs.type) && mAttrs.type != TYPE_TOAST)) {
            return;
        }