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

Commit 2502b2f9 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Ignore virtual presentation windows" into udc-dev am: a8285b52...

Merge "Merge "Ignore virtual presentation windows" into udc-dev am: a8285b52 am: 2ab3ac02" into udc-d1-dev-plus-aosp am: fad4fd81

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23382463



Change-Id: Ib3021ec17cafd92ac072d266108aa154de9ecd98
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a997c6d5 fad4fd81
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -3393,12 +3393,20 @@ 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);
        }
    }

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

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