Loading services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +13 −5 Original line number Diff line number Diff line Loading @@ -3113,7 +3113,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (which == FLAG_SYSTEM && systemIsStatic && systemIsBoth) { Slog.i(TAG, "Migrating current wallpaper to be lock-only before" + " updating system wallpaper"); migrateStaticSystemToLockWallpaperLocked(userId); if (!migrateStaticSystemToLockWallpaperLocked(userId) && !isLockscreenLiveWallpaperEnabled()) { which |= FLAG_LOCK; } } wallpaper = getWallpaperSafeLocked(userId, which); Loading Loading @@ -3141,13 +3144,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } private void migrateStaticSystemToLockWallpaperLocked(int userId) { private boolean migrateStaticSystemToLockWallpaperLocked(int userId) { WallpaperData sysWP = mWallpaperMap.get(userId); if (sysWP == null) { if (DEBUG) { Slog.i(TAG, "No system wallpaper? Not tracking for lock-only"); } return; return true; } // We know a-priori that there is no lock-only wallpaper currently Loading @@ -3174,9 +3177,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub SELinux.restorecon(lockWP.getWallpaperFile()); mLastLockWallpaper = lockWP; } return true; } catch (ErrnoException e) { Slog.e(TAG, "Can't migrate system wallpaper: " + e.getMessage()); // can happen when migrating default wallpaper (which is not stored in wallpaperFile) Slog.w(TAG, "Couldn't migrate system wallpaper: " + e.getMessage()); clearWallpaperBitmaps(lockWP); return false; } } Loading Loading @@ -3388,7 +3394,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub // therefore it's a shared system+lock image that we need to migrate. Slog.i(TAG, "Migrating current wallpaper to be lock-only before" + "updating system wallpaper"); migrateStaticSystemToLockWallpaperLocked(userId); if (!migrateStaticSystemToLockWallpaperLocked(userId)) { which |= FLAG_LOCK; } } } Loading Loading
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +13 −5 Original line number Diff line number Diff line Loading @@ -3113,7 +3113,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (which == FLAG_SYSTEM && systemIsStatic && systemIsBoth) { Slog.i(TAG, "Migrating current wallpaper to be lock-only before" + " updating system wallpaper"); migrateStaticSystemToLockWallpaperLocked(userId); if (!migrateStaticSystemToLockWallpaperLocked(userId) && !isLockscreenLiveWallpaperEnabled()) { which |= FLAG_LOCK; } } wallpaper = getWallpaperSafeLocked(userId, which); Loading Loading @@ -3141,13 +3144,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } private void migrateStaticSystemToLockWallpaperLocked(int userId) { private boolean migrateStaticSystemToLockWallpaperLocked(int userId) { WallpaperData sysWP = mWallpaperMap.get(userId); if (sysWP == null) { if (DEBUG) { Slog.i(TAG, "No system wallpaper? Not tracking for lock-only"); } return; return true; } // We know a-priori that there is no lock-only wallpaper currently Loading @@ -3174,9 +3177,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub SELinux.restorecon(lockWP.getWallpaperFile()); mLastLockWallpaper = lockWP; } return true; } catch (ErrnoException e) { Slog.e(TAG, "Can't migrate system wallpaper: " + e.getMessage()); // can happen when migrating default wallpaper (which is not stored in wallpaperFile) Slog.w(TAG, "Couldn't migrate system wallpaper: " + e.getMessage()); clearWallpaperBitmaps(lockWP); return false; } } Loading Loading @@ -3388,7 +3394,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub // therefore it's a shared system+lock image that we need to migrate. Slog.i(TAG, "Migrating current wallpaper to be lock-only before" + "updating system wallpaper"); migrateStaticSystemToLockWallpaperLocked(userId); if (!migrateStaticSystemToLockWallpaperLocked(userId)) { which |= FLAG_LOCK; } } } Loading