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

Commit 277fb13f authored by wilsonshih's avatar wilsonshih
Browse files

Commit wallpaper visibility directly when target token is invisibile

When first transition finish and another transition is collecting, the
wallpaper can be collected if the first transition has commit an
invisible activity(e.g. Launcher), there should just hide wallpaper.

Bug: 290203002
Test: manual, run test app from shortcut.
Change-Id: I7f2d49ee942f3be83bd6e6c34ec99299f14281d9
parent 01a9c09f
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
@@ -1177,16 +1177,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();
@@ -1206,6 +1196,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();
        }