Loading services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +11 −20 Original line number Diff line number Diff line Loading @@ -2000,7 +2000,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData wallpaper, IRemoteCallback reply, ServiceInfo serviceInfo) { if (serviceInfo == null) { if (wallpaper.mWhich == (FLAG_LOCK | FLAG_SYSTEM)) { clearWallpaperLocked(FLAG_SYSTEM, wallpaper.userId, null); clearWallpaperLocked(FLAG_LOCK, wallpaper.userId, reply); } else { clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, reply); } return; } Slog.w(TAG, "Wallpaper isn't direct boot aware; using fallback until unlocked"); Loading Loading @@ -2032,7 +2037,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData data = null; synchronized (mLock) { if (mIsLockscreenLiveWallpaperEnabled) { clearWallpaperLocked(callingPackage, which, userId, null); clearWallpaperLocked(callingPackage, which, userId); } else { clearWallpaperLocked(which, userId, null); } Loading @@ -2052,8 +2057,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } private void clearWallpaperLocked(String callingPackage, int which, int userId, IRemoteCallback reply) { private void clearWallpaperLocked(String callingPackage, int which, int userId) { // Might need to bring it in the first time to establish our rewrite if (!mWallpaperMap.contains(userId)) { Loading Loading @@ -2107,14 +2111,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub withCleanCallingIdentity(() -> clearWallpaperComponentLocked(wallpaper)); } // TODO(b/266818039) remove this version of the method private void clearWallpaperLocked(int which, int userId, IRemoteCallback reply) { if (mIsLockscreenLiveWallpaperEnabled) { String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid()); clearWallpaperLocked(callingPackage, which, userId, reply); return; } if (which != FLAG_SYSTEM && which != FLAG_LOCK) { throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear"); } Loading Loading @@ -3286,21 +3284,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub boolean setWallpaperComponent(ComponentName name, String callingPackage, @SetWallpaperFlags int which, int userId) { if (mIsLockscreenLiveWallpaperEnabled) { return setWallpaperComponentInternal(name, callingPackage, which, userId, null); return setWallpaperComponentInternal(name, callingPackage, which, userId); } else { setWallpaperComponentInternalLegacy(name, callingPackage, which, userId); return true; } } private boolean setWallpaperComponent(ComponentName name, @SetWallpaperFlags int which, int userId) { String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid()); return setWallpaperComponentInternal(name, callingPackage, which, userId, null); } private boolean setWallpaperComponentInternal(ComponentName name, String callingPackage, @SetWallpaperFlags int which, int userIdIn, IRemoteCallback reply) { @SetWallpaperFlags int which, int userIdIn) { if (DEBUG) { Slog.v(TAG, "Setting new live wallpaper: which=" + which + ", component: " + name); } Loading Loading @@ -3349,7 +3341,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub Slog.d(TAG, "publish system wallpaper changed!"); } liveSync.complete(); if (reply != null) reply.sendResult(null); } }; Loading Loading
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +11 −20 Original line number Diff line number Diff line Loading @@ -2000,7 +2000,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData wallpaper, IRemoteCallback reply, ServiceInfo serviceInfo) { if (serviceInfo == null) { if (wallpaper.mWhich == (FLAG_LOCK | FLAG_SYSTEM)) { clearWallpaperLocked(FLAG_SYSTEM, wallpaper.userId, null); clearWallpaperLocked(FLAG_LOCK, wallpaper.userId, reply); } else { clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, reply); } return; } Slog.w(TAG, "Wallpaper isn't direct boot aware; using fallback until unlocked"); Loading Loading @@ -2032,7 +2037,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData data = null; synchronized (mLock) { if (mIsLockscreenLiveWallpaperEnabled) { clearWallpaperLocked(callingPackage, which, userId, null); clearWallpaperLocked(callingPackage, which, userId); } else { clearWallpaperLocked(which, userId, null); } Loading @@ -2052,8 +2057,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } private void clearWallpaperLocked(String callingPackage, int which, int userId, IRemoteCallback reply) { private void clearWallpaperLocked(String callingPackage, int which, int userId) { // Might need to bring it in the first time to establish our rewrite if (!mWallpaperMap.contains(userId)) { Loading Loading @@ -2107,14 +2111,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub withCleanCallingIdentity(() -> clearWallpaperComponentLocked(wallpaper)); } // TODO(b/266818039) remove this version of the method private void clearWallpaperLocked(int which, int userId, IRemoteCallback reply) { if (mIsLockscreenLiveWallpaperEnabled) { String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid()); clearWallpaperLocked(callingPackage, which, userId, reply); return; } if (which != FLAG_SYSTEM && which != FLAG_LOCK) { throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear"); } Loading Loading @@ -3286,21 +3284,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub boolean setWallpaperComponent(ComponentName name, String callingPackage, @SetWallpaperFlags int which, int userId) { if (mIsLockscreenLiveWallpaperEnabled) { return setWallpaperComponentInternal(name, callingPackage, which, userId, null); return setWallpaperComponentInternal(name, callingPackage, which, userId); } else { setWallpaperComponentInternalLegacy(name, callingPackage, which, userId); return true; } } private boolean setWallpaperComponent(ComponentName name, @SetWallpaperFlags int which, int userId) { String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid()); return setWallpaperComponentInternal(name, callingPackage, which, userId, null); } private boolean setWallpaperComponentInternal(ComponentName name, String callingPackage, @SetWallpaperFlags int which, int userIdIn, IRemoteCallback reply) { @SetWallpaperFlags int which, int userIdIn) { if (DEBUG) { Slog.v(TAG, "Setting new live wallpaper: which=" + which + ", component: " + name); } Loading Loading @@ -3349,7 +3341,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub Slog.d(TAG, "publish system wallpaper changed!"); } liveSync.complete(); if (reply != null) reply.sendResult(null); } }; Loading