From b040a224fdb3fef98fab4686a8c3a301e18da31e Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Wed, 13 May 2020 20:49:09 +0800 Subject: [PATCH] Allow wallpaper to be visible if wallpaper target exists. When entering PIP task, the obscured condition will be changed after the fullscreen task reparent to PIP task, and since the PIP animation is moved out, the opening animation of enter NexusLauncher will not synced with SystemUI, so wallpaper could become invisible during we moving a fullscreen task to PIP task. So a simple fix idea is that if the wallpaper target is visible, then wallpaper should also be visible. And review the findWallpaperTarget method, we find the check conditions have been duplicated with isWallpaperVisible, so we can simplify the method isWallpaperVisible by checking whether the wallpaper target exists. Fixes: 156014070 Test: atest WallpaperControllerTests Change-Id: Ib02f1e6ce10d4c412d049aa84541f5a5323fd455 --- .../server/wm/WallpaperController.java | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java index b9b6c0858031e..d1cb2105246a7 100644 --- a/services/core/java/com/android/server/wm/WallpaperController.java +++ b/services/core/java/com/android/server/wm/WallpaperController.java @@ -238,23 +238,12 @@ class WallpaperController { } } - private final boolean isWallpaperVisible(WindowState wallpaperTarget) { - final RecentsAnimationController recentsAnimationController = - mService.getRecentsAnimationController(); - boolean isAnimatingWithRecentsComponent = recentsAnimationController != null - && recentsAnimationController.isWallpaperVisible(wallpaperTarget); - if (DEBUG_WALLPAPER) Slog.v(TAG, "Wallpaper vis: target " + wallpaperTarget + ", obscured=" - + (wallpaperTarget != null ? Boolean.toString(wallpaperTarget.mObscured) : "??") - + " animating=" + ((wallpaperTarget != null && wallpaperTarget.mActivityRecord != null) - ? wallpaperTarget.mActivityRecord.isAnimating(TRANSITION | PARENTS) : null) - + " prev=" + mPrevWallpaperTarget - + " recentsAnimationWallpaperVisible=" + isAnimatingWithRecentsComponent); - return (wallpaperTarget != null - && (!wallpaperTarget.mObscured - || isAnimatingWithRecentsComponent - || (wallpaperTarget.mActivityRecord != null - && wallpaperTarget.mActivityRecord.isAnimating(TRANSITION | PARENTS)))) - || mPrevWallpaperTarget != null; + private boolean isWallpaperVisible(WindowState wallpaperTarget) { + if (DEBUG_WALLPAPER) { + Slog.v(TAG, "Wallpaper vis: target " + wallpaperTarget + " prev=" + + mPrevWallpaperTarget); + } + return wallpaperTarget != null || mPrevWallpaperTarget != null; } boolean isWallpaperTargetAnimating() {