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

Commit 009c7c26 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Commit wallpaper visibility directly when target token is invisibile" into udc-qpr-dev

parents e050b1f1 277fb13f
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -5660,13 +5660,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final DisplayContent displayContent = getDisplayContent();
        if (!visible) {
            mImeInsetsFrozenUntilStartInput = true;
            if (usingShellTransitions) {
                final WindowState wallpaperTarget =
                        displayContent.mWallpaperController.getWallpaperTarget();
                if (wallpaperTarget != null && wallpaperTarget.mActivityRecord == this) {
                    displayContent.mWallpaperController.hideWallpapers(wallpaperTarget);
                }
            }
        }

        if (!displayContent.mClosingApps.contains(this)
+14 −10
Original line number Diff line number Diff line
@@ -1191,16 +1191,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                hasParticipatedDisplay = true;
                continue;
            }
            final WallpaperWindowToken wt = participant.asWallpaperToken();
            if (wt != null) {
                final boolean visibleAtTransitionEnd = mVisibleAtTransitionEndTokens.contains(wt);
                if (!visibleAtTransitionEnd && !wt.isVisibleRequested()) {
                    ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
                            "  Commit wallpaper becoming invisible: %s", wt);
                    wt.commitVisibility(false /* visible */);
                }
                continue;
            }
            final Task tr = participant.asTask();
            if (tr != null && tr.isVisibleRequested() && tr.inPinnedWindowingMode()) {
                final ActivityRecord top = tr.getTopNonFinishingActivity();
@@ -1220,6 +1210,20 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                }
            }
        }
        // Commit wallpaper visibility after activity, because usually the wallpaper target token is
        // an activity, and wallpaper's visibility is depends on activity's visibility.
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
            final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken();
            if (wt == null) continue;
            final WindowState target = wt.mDisplayContent.mWallpaperController.getWallpaperTarget();
            final boolean isTargetInvisible = target == null || !target.mToken.isVisible();
            if (isTargetInvisible || (!wt.isVisibleRequested()
                    && !mVisibleAtTransitionEndTokens.contains(wt))) {
                ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
                        "  Commit wallpaper becoming invisible: %s", wt);
                wt.commitVisibility(false /* visible */);
            }
        }
        if (committedSomeInvisible) {
            mController.onCommittedInvisibles();
        }