OSDN Git Service

Assign a new wallpaper ID when a live wallpaper is set
authorChristopher Tate <ctate@google.com>
Fri, 25 Mar 2016 20:41:46 +0000 (13:41 -0700)
committerChristopher Tate <ctate@google.com>
Fri, 25 Mar 2016 22:06:24 +0000 (15:06 -0700)
Bug 27851191

Change-Id: I5fc490e38d80e1b357ef44cdcabbad41c8bd9a93

services/core/java/com/android/server/wallpaper/WallpaperManagerService.java

index fb9b1ce..4848523 100644 (file)
@@ -1262,6 +1262,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
         return null;
     }
 
+    @Override
     public void setWallpaperComponentChecked(ComponentName name, String callingPackage) {
         if (isWallpaperSupported(callingPackage) && isWallpaperSettingAllowed(callingPackage)) {
             setWallpaperComponent(name);
@@ -1269,6 +1270,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
     }
 
     // ToDo: Remove this version of the function
+    @Override
     public void setWallpaperComponent(ComponentName name) {
         checkPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT);
         synchronized (mLock) {
@@ -1281,7 +1283,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
             final long ident = Binder.clearCallingIdentity();
             try {
                 wallpaper.imageWallpaperPending = false;
-                bindWallpaperComponentLocked(name, false, true, wallpaper, null);
+                if (bindWallpaperComponentLocked(name, false, true, wallpaper, null)) {
+                    wallpaper.wallpaperId = makeWallpaperIdLocked();
+                }
             } finally {
                 Binder.restoreCallingIdentity(ident);
             }