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

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

Merge "Skip collecting requesting-invisible wallpaper if no target" into main

parents 5eebcdb8 5ae73328
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -193,11 +193,11 @@ class WallpaperWindowToken extends WindowToken {
        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
            final boolean isTargetNotCollectedActivity = wpTarget == null
                    || (wpTarget.mActivityRecord != null
                            && !mTransitionController.isCollecting(wpTarget.mActivityRecord));
            // Skip collecting requesting-invisible wallpaper if the wallpaper target is empty or
            // a non-collected activity. 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.
+2 −0
Original line number Diff line number Diff line
@@ -410,6 +410,8 @@ public class WallpaperControllerTests extends WindowTestsBase {
        final WindowState wallpaperWindow = createWallpaperWindow(dc);
        final WallpaperWindowToken token = wallpaperWindow.mToken.asWallpaperToken();
        wallpaperWindow.setHasSurface(true);
        spyOn(dc.mWallpaperController);
        doReturn(wallpaperWindow).when(dc.mWallpaperController).getWallpaperTarget();

        // Set-up mock shell transitions
        registerTestTransitionPlayer();