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

Commit 5c30e642 authored by Achim Thesmann's avatar Achim Thesmann Committed by Android (Google) Code Review
Browse files

Merge "Ignore virtual presentation windows - RESTRICT AUTOMERGE" into sc-v2-dev

parents b0f31ff6 42557cb5
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -3616,8 +3616,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // apps won't always be considered as foreground state.
        // Exclude private presentations as they can only be shown on private virtual displays and
        // shouldn't be the cause of an app be considered foreground.
        if (mAttrs.type >= FIRST_SYSTEM_WINDOW && mAttrs.type != TYPE_TOAST
                && mAttrs.type != TYPE_PRIVATE_PRESENTATION) {
        // Exclude presentations on virtual displays as they are not actually visible.
        if (mAttrs.type >= FIRST_SYSTEM_WINDOW
                && mAttrs.type != TYPE_TOAST
                && mAttrs.type != TYPE_PRIVATE_PRESENTATION
                && !(mAttrs.type == TYPE_PRESENTATION && isOnVirtualDisplay())
        ) {
            mWmService.mAtmService.mActiveUids.onNonAppSurfaceVisibilityChanged(mOwnerUid, shown);
        }
        if (mIsImWindow && mWmService.mAccessibilityController.hasCallbacks()) {
@@ -3625,6 +3629,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
    }

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

    private void logExclusionRestrictions(int side) {
        if (!logsGestureExclusionRestrictions(this)
                || SystemClock.uptimeMillis() < mLastExclusionLogUptimeMillis[side]