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

Commit 07019d90 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Ignore virtual presentation windows - RESTRICT AUTOMERGE

Windows of TYPE_PRESENTATION on virtual displays should not be counted
as visible windows to determine if BAL is allowed.

Test: manual test, atest BackgroundActivityLaunchTest
Bug: 264029851, 205130886
Merged-In: I08b16ba1c155e951286ddc22019180cbd6334dfa
Change-Id: I0f6bc691ca50582cb56e3b8a7ade14eac1660358
parent 6f9b881a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
@@ -5820,7 +5819,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     */
    boolean isNonToastOrStartingOrPrivatePresentation() {
        return mAttrs.type != TYPE_TOAST && mAttrs.type != TYPE_APPLICATION_STARTING
                && mAttrs.type != TYPE_PRIVATE_PRESENTATION;
                && mAttrs.type != TYPE_PRIVATE_PRESENTATION
                && !(mAttrs.type == TYPE_PRESENTATION && isOnVirtualDisplay());
    }

    boolean isNonToastWindowVisibleForUid(int callingUid) {
@@ -5833,6 +5833,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                && isVisibleNow();
    }

    private boolean isOnVirtualDisplay() {
        return getDisplayContent().mDisplay.getType() == Display.TYPE_VIRTUAL;
    }

    void setViewVisibility(int viewVisibility) {
        mViewVisibility = viewVisibility;
        // The viewVisibility is set to GONE with a client request to relayout. If this occurs and