From f0a9429cc250f30f20375c9a6ebe9fbe0cb0082f Mon Sep 17 00:00:00 2001 From: Issei Suzuki Date: Tue, 22 Feb 2022 17:12:08 +0000 Subject: [PATCH] Keep showing wallpaper when starting an app immediatly after unlock. Wallpaper is controlled by NotificationShade while the lock screen is shown, otherwise by the launcher. We used to switch it when unlock animation finishes, but it caused an issue when a user starts anotehr app transition (e.g. launch an app by tapping an icon on a home screen) before the unlock animation finishes. We give higher priority on the launcher to NotificationShade, so that this switch happens earlier. Bug: 215685199 Test: Manual. Unlock the device and taps an app icon to launch it. Change-Id: Iddf58c3a3966e285870711f39b73eee7dab804e0 --- .../java/com/android/server/wm/WallpaperController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java index 4b2aa0f76272e..b61e711d75f51 100644 --- a/services/core/java/com/android/server/wm/WallpaperController.java +++ b/services/core/java/com/android/server/wm/WallpaperController.java @@ -202,8 +202,11 @@ class WallpaperController { "Win " + w + ": token animating, looking behind."); } mFindResults.setIsWallpaperTargetForLetterbox(w.hasWallpaperForLetterboxBackground()); - // Found a target! End search. - return true; + // While the keyguard is going away, both notification shade and a normal activity such + // as a launcher can satisfy criteria for a wallpaper target. In this case, we should + // chose the normal activity, otherwise wallpaper becomes invisible when a new animation + // starts before the keyguard going away animation finishes. + return w.mActivityRecord != null; } return false; };