diff options
| -rw-r--r-- | services/core/java/com/android/server/wallpaper/WallpaperManagerService.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index 309a9c0e0372..5b25e890aaa2 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -321,9 +321,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish system wallpaper changed!"); } - if (localSync != null) { - localSync.complete(); - } notifyWallpaperChanged(wallpaper); } }; @@ -331,7 +328,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub // If this was the system wallpaper, rebind... bindWallpaperComponentLocked(mImageWallpaper, true, false, wallpaper, callback); - notifyColorsWhich |= FLAG_SYSTEM; + notifyColorsWhich |= wallpaper.mWhich; } if (lockWallpaperChanged) { @@ -345,9 +342,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish lock wallpaper changed!"); } - if (localSync != null) { - localSync.complete(); - } notifyWallpaperChanged(wallpaper); } }; @@ -372,9 +366,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } saveSettingsLocked(wallpaper.userId); - // Notify the client immediately if only lockscreen wallpaper changed. - if (lockWallpaperChanged && !sysWallpaperChanged) { - notifyWallpaperChanged(wallpaper); + if ((sysWallpaperChanged || lockWallpaperChanged) && localSync != null) { + localSync.complete(); } } @@ -1383,7 +1376,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub lockWp.connection.mWallpaper = lockWp; mOriginalSystem.mWhich = FLAG_LOCK; updateEngineFlags(mOriginalSystem); - notifyWallpaperColorsChanged(lockWp, FLAG_LOCK); } else { // Failed rename, use current system wp for both if (DEBUG) { @@ -1403,7 +1395,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub updateEngineFlags(mOriginalSystem); mLockWallpaperMap.put(mNewWallpaper.userId, mOriginalSystem); mLastLockWallpaper = mOriginalSystem; - notifyWallpaperColorsChanged(mOriginalSystem, FLAG_LOCK); } } else if (mNewWallpaper.mWhich == FLAG_LOCK) { // New wp is lock only, so old system+lock is now system only @@ -1417,10 +1408,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } } - - synchronized (mLock) { - saveSettingsLocked(mNewWallpaper.userId); - } + saveSettingsLocked(mNewWallpaper.userId); if (DEBUG) { Slog.v(TAG, "--- wallpaper changed --"); @@ -3300,7 +3288,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish system wallpaper changed!"); } - liveSync.complete(); } }; @@ -3356,6 +3343,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } mLockWallpaperMap.remove(newWallpaper.userId); } + if (liveSync != null) liveSync.complete(); } } finally { Binder.restoreCallingIdentity(ident); @@ -3474,6 +3462,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } // Has the component changed? if (!force && changingToSame(componentName, wallpaper)) { + try { + if (reply != null) reply.sendResult(null); + } catch (RemoteException e) { + Slog.e(TAG, "Failed to send callback", e); + } return true; } |