Loading services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +15 −11 Original line number Diff line number Diff line Loading @@ -1138,7 +1138,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { mMonitor = new MyPackageMonitor(); mMonitor.register(context, null, UserHandle.ALL, true); getWallpaperDir(UserHandle.USER_SYSTEM).mkdirs(); // Initialize state from the persistent store, then guarantee that the // WallpaperData for the system imagery is instantiated & active, creating // it from defaults if necessary. loadSettingsLocked(UserHandle.USER_SYSTEM, false); getWallpaperSafeLocked(UserHandle.USER_SYSTEM, FLAG_SYSTEM); mColorsChangedListeners = new SparseArray<>(); } Loading Loading @@ -1627,14 +1633,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { (which == FLAG_LOCK) ? mLockWallpaperMap : mWallpaperMap; WallpaperData wallpaper = whichSet.get(wallpaperUserId); if (wallpaper == null) { // common case, this is the first lookup post-boot of the system or // unified lock, so we bring up the saved state lazily now and recheck. loadSettingsLocked(wallpaperUserId, false); wallpaper = whichSet.get(wallpaperUserId); if (wallpaper == null) { // There is no established wallpaper imagery of this type (expected // only for lock wallpapers; a system WallpaperData is established at // user switch) return null; } } try { if (outParams != null) { outParams.putInt("width", wallpaper.width); Loading @@ -1658,7 +1661,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { @Override public WallpaperInfo getWallpaperInfo(int userId) { userId = ActivityManager.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getWallpaperIdForUser", null); Binder.getCallingUid(), userId, false, true, "getWallpaperInfo", null); synchronized (mLock) { WallpaperData wallpaper = mWallpaperMap.get(userId); if (wallpaper != null && wallpaper.connection != null) { Loading Loading @@ -2260,7 +2263,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { private void writeWallpaperAttributes(XmlSerializer out, String tag, WallpaperData wallpaper) throws IllegalArgumentException, IllegalStateException, IOException { if (DEBUG) { Slog.v(TAG, "writeWallpaperAttributes"); Slog.v(TAG, "writeWallpaperAttributes id=" + wallpaper.wallpaperId); } out.startTag(null, tag); out.attribute(null, "id", Integer.toString(wallpaper.wallpaperId)); Loading Loading @@ -2359,6 +2362,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { * the event yet. We use this safe method when we don't care about this ordering and just * want to update the data. The data is going to be applied when the user switch observer * is eventually executed. * * Important: this method loads settings to initialize the given user's wallpaper data if * there is no current in-memory state. */ private WallpaperData getWallpaperSafeLocked(int userId, int which) { // We're setting either just system (work with the system wallpaper), Loading Loading @@ -2397,8 +2403,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { } private void loadSettingsLocked(int userId, boolean keepDimensionHints) { if (DEBUG) Slog.v(TAG, "loadSettingsLocked"); JournaledFile journal = makeJournaledFile(userId); FileInputStream stream = null; File file = journal.chooseForRead(); Loading Loading
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +15 −11 Original line number Diff line number Diff line Loading @@ -1138,7 +1138,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { mMonitor = new MyPackageMonitor(); mMonitor.register(context, null, UserHandle.ALL, true); getWallpaperDir(UserHandle.USER_SYSTEM).mkdirs(); // Initialize state from the persistent store, then guarantee that the // WallpaperData for the system imagery is instantiated & active, creating // it from defaults if necessary. loadSettingsLocked(UserHandle.USER_SYSTEM, false); getWallpaperSafeLocked(UserHandle.USER_SYSTEM, FLAG_SYSTEM); mColorsChangedListeners = new SparseArray<>(); } Loading Loading @@ -1627,14 +1633,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { (which == FLAG_LOCK) ? mLockWallpaperMap : mWallpaperMap; WallpaperData wallpaper = whichSet.get(wallpaperUserId); if (wallpaper == null) { // common case, this is the first lookup post-boot of the system or // unified lock, so we bring up the saved state lazily now and recheck. loadSettingsLocked(wallpaperUserId, false); wallpaper = whichSet.get(wallpaperUserId); if (wallpaper == null) { // There is no established wallpaper imagery of this type (expected // only for lock wallpapers; a system WallpaperData is established at // user switch) return null; } } try { if (outParams != null) { outParams.putInt("width", wallpaper.width); Loading @@ -1658,7 +1661,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { @Override public WallpaperInfo getWallpaperInfo(int userId) { userId = ActivityManager.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getWallpaperIdForUser", null); Binder.getCallingUid(), userId, false, true, "getWallpaperInfo", null); synchronized (mLock) { WallpaperData wallpaper = mWallpaperMap.get(userId); if (wallpaper != null && wallpaper.connection != null) { Loading Loading @@ -2260,7 +2263,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { private void writeWallpaperAttributes(XmlSerializer out, String tag, WallpaperData wallpaper) throws IllegalArgumentException, IllegalStateException, IOException { if (DEBUG) { Slog.v(TAG, "writeWallpaperAttributes"); Slog.v(TAG, "writeWallpaperAttributes id=" + wallpaper.wallpaperId); } out.startTag(null, tag); out.attribute(null, "id", Integer.toString(wallpaper.wallpaperId)); Loading Loading @@ -2359,6 +2362,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { * the event yet. We use this safe method when we don't care about this ordering and just * want to update the data. The data is going to be applied when the user switch observer * is eventually executed. * * Important: this method loads settings to initialize the given user's wallpaper data if * there is no current in-memory state. */ private WallpaperData getWallpaperSafeLocked(int userId, int which) { // We're setting either just system (work with the system wallpaper), Loading Loading @@ -2397,8 +2403,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { } private void loadSettingsLocked(int userId, boolean keepDimensionHints) { if (DEBUG) Slog.v(TAG, "loadSettingsLocked"); JournaledFile journal = makeJournaledFile(userId); FileInputStream stream = null; File file = journal.chooseForRead(); Loading