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

Commit 24f4ebf4 authored by Linus Tufvesson's avatar Linus Tufvesson Committed by Automerger Merge Worker
Browse files

DO NOT MERGE - Exclude TYPE_PRIVATE_PRESENTATION app visiblity am: 778191bd

parents 7cc9540c 778191bd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -569,8 +569,9 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
    /**
     * Returns {@code true} if the callingUid has any non-toast window currently visible to the
     * user. Also ignores {@link android.view.WindowManager.LayoutParams#TYPE_APPLICATION_STARTING},
     * since those windows don't belong to apps.
     * @see WindowState#isNonToastOrStarting()
     * and{@link android.view.WindowManager.LayoutParams#TYPE_PRIVATE_PRESENTATION}, as they
     * should not count towards the apps visibility
     * @see WindowState#isNonToastOrStartingOrPrivatePresentation()
     */
    boolean isAnyNonToastWindowVisibleForUid(int callingUid) {
        final PooledPredicate p = PooledLambda.obtainPredicate(
+11 −7
Original line number Diff line number Diff line
@@ -5833,20 +5833,24 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    }

    /**
     * Returns {@code true} if this window is not {@link WindowManager.LayoutParams#TYPE_TOAST}
     * or {@link WindowManager.LayoutParams#TYPE_APPLICATION_STARTING},
     * since this window doesn't belong to apps.
     * Returns {@code true} if this window is not {@link WindowManager.LayoutParams#TYPE_TOAST},
     * {@link WindowManager.LayoutParams#TYPE_APPLICATION_STARTING} or
     * {@link WindowManager.LayoutParams#TYPE_PRIVATE_PRESENTATION},
     * since those windows should not count towards the apps visibility.
     */
    boolean isNonToastOrStarting() {
        return mAttrs.type != TYPE_TOAST && mAttrs.type != TYPE_APPLICATION_STARTING;
    boolean isNonToastOrStartingOrPrivatePresentation() {
        return mAttrs.type != TYPE_TOAST && mAttrs.type != TYPE_APPLICATION_STARTING
                && mAttrs.type != TYPE_PRIVATE_PRESENTATION;
    }

    boolean isNonToastWindowVisibleForUid(int callingUid) {
        return getOwningUid() == callingUid && isNonToastOrStarting() && isVisibleNow();
        return getOwningUid() == callingUid && isNonToastOrStartingOrPrivatePresentation()
                && isVisibleNow();
    }

    boolean isNonToastWindowVisibleForPid(int pid) {
        return mSession.mPid == pid && isNonToastOrStarting() && isVisibleNow();
        return mSession.mPid == pid && isNonToastOrStartingOrPrivatePresentation()
                && isVisibleNow();
    }

    void setViewVisibility(int viewVisibility) {