diff options
| author | 2023-09-12 13:46:45 +0000 | |
|---|---|---|
| committer | 2023-09-12 13:46:45 +0000 | |
| commit | 0226960b967053dc93c4d82cbaae6994f72350e3 (patch) | |
| tree | 0d704a1a4c13a9d4fbf35548fa24f6cc1d498c05 | |
| parent | 470327fec051493f4497b73f81ef219d47bfeb02 (diff) | |
| parent | bf81d0710bd24fff9d111b14db4897867aba4343 (diff) | |
Merge "Run liveSync/localSync.complete() earlier" into udc-qpr-dev am: 712fca5154 am: bf81d0710b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24622048
Change-Id: I8952c571091371339779ad2d5a5f3d1d81c46ef4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -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 ddc05194c300..cfc7031d01d7 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -326,9 +326,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish system wallpaper changed!"); } - if (localSync != null) { - localSync.complete(); - } notifyWallpaperChanged(wallpaper); } }; @@ -336,7 +333,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) { @@ -350,9 +347,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish lock wallpaper changed!"); } - if (localSync != null) { - localSync.complete(); - } notifyWallpaperChanged(wallpaper); } }; @@ -377,9 +371,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(); } } @@ -1426,7 +1419,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) { @@ -1446,7 +1438,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 @@ -1460,10 +1451,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } } - - synchronized (mLock) { - saveSettingsLocked(mNewWallpaper.userId); - } + saveSettingsLocked(mNewWallpaper.userId); if (DEBUG) { Slog.v(TAG, "--- wallpaper changed --"); @@ -3340,7 +3328,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub if (DEBUG) { Slog.d(TAG, "publish system wallpaper changed!"); } - liveSync.complete(); } }; @@ -3396,6 +3383,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } mLockWallpaperMap.remove(newWallpaper.userId); } + if (liveSync != null) liveSync.complete(); } } finally { Binder.restoreCallingIdentity(ident); @@ -3514,6 +3502,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; } |