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

Commit b779f47e authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Skip collecting wallpaper to transition for non collected app" into main

parents e3c1b90e c2ec6faa
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -192,7 +192,18 @@ class WallpaperWindowToken extends WindowToken {
    void setVisibility(boolean visible) {
        if (mVisibleRequested != visible) {
            // Before setting mVisibleRequested so we can track changes.
            final WindowState wpTarget = mDisplayContent.mWallpaperController.getWallpaperTarget();
            final boolean isTargetNotCollectedActivity = wpTarget != null
                    && wpTarget.mActivityRecord != null
                    && !mTransitionController.isCollecting(wpTarget.mActivityRecord);
            // Skip collecting requesting-invisible wallpaper if the wallpaper target is an activity
            // and it is not collected. Because the visibility change may be called after the
            // transition of activity is finished, e.g. WallpaperController#hideWallpapers from
            // hiding surface of the target. Then if there is a next transition, the wallpaper
            // change may be collected into the unrelated transition and cause a weird animation.
            if (!isTargetNotCollectedActivity || visible) {
                mTransitionController.collect(this);
            }

            setVisibleRequested(visible);
        }