From a47fcc974afece721a661617a24b9e2abbf5949a Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 26 Apr 2018 14:27:38 +0800 Subject: [PATCH] Reload wallpaper after user unlock. Live wallpaper may not support direct-boot aware, however, those kind of wallpapers should be showed after user unlock. It may not suit to call switchUser after onUnlockUser since there is no user switch happen. Bug: 78539162 Test: Manual test, reboot and switch users. Change-Id: I99f8ad99c913ac05bc51c38c3da5aa51c0ba98fd --- .../android/server/wallpaper/WallpaperManagerService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index 0ccbb251d2a27..a7c203dca03bb 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1303,8 +1303,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub synchronized (mLock) { if (mCurrentUserId == userId) { if (mWaitingForUnlock) { - // If we're switching users, now is when we transition the wallpaper - switchUser(userId, null); + // the desired wallpaper is not direct-boot aware, load it now + final WallpaperData systemWallpaper = + getWallpaperSafeLocked(userId, FLAG_SYSTEM); + switchWallpaper(systemWallpaper, null); } // Make sure that the SELinux labeling of all the relevant files is correct.