From 900b78a92cd67d9760d1b65cbef0196108d0fc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pomini?= Date: Wed, 7 Jun 2023 09:31:31 +0000 Subject: [PATCH] Persist wallpaper changes after migration After a migration (e.g. set a wallpaper on home when having a live wallpaper on home+lock), the changes need to be persisted in wallpaper_info.xml. Otherwise after reboot, the wallpapers won't be rendered correctly. The complete() method of this CL is only called when the lockscreen livewallpaper flag is enabled, so this change is under flag. Flag: lockscreen lwp Bug: 286061806 Test: atest WallpaperManagerTest Test: manually check that the bug is fixed Change-Id: I704761c20e66e279a0e080e29dff3fa788d2ecf1 --- .../com/android/server/wallpaper/WallpaperManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index aa553efae8afa..c38bfd759555b 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1417,6 +1417,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } + synchronized (mLock) { + saveSettingsLocked(mNewWallpaper.userId); + } + if (DEBUG) { Slog.v(TAG, "--- wallpaper changed --"); Slog.v(TAG, "new sysWp: " + mWallpaperMap.get(mCurrentUserId));