diff options
| author | 2025-03-04 08:43:04 -0800 | |
|---|---|---|
| committer | 2025-03-04 08:43:04 -0800 | |
| commit | e0e6cf984298c195f051f40a641c8600ea6c0e9c (patch) | |
| tree | f8af0d1f739dbefa74d9732e42f15de63435e547 | |
| parent | e26009f8056d242053c2df2885cbbf44b00e3460 (diff) | |
| parent | b23d0042a64167e0de95da154ab0ab83c5424f6e (diff) | |
Merge "Fix missing wallpaper description on live wallpaper rebind" into main
| -rw-r--r-- | services/core/java/com/android/server/wallpaper/WallpaperManagerService.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index d620e98d3437..bac732637d8d 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1173,12 +1173,19 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return; } - final ComponentName wpService = mWallpaper.getComponent(); // The broadcast of package update could be delayed after service disconnected. Try // to re-bind the service for 10 seconds. mWallpaper.mBindSource = BindSource.CONNECTION_TRY_TO_REBIND; - if (bindWallpaperComponentLocked( - wpService, true, false, mWallpaper, null)) { + boolean success; + if (liveWallpaperContentHandling()) { + success = bindWallpaperDescriptionLocked( + mWallpaper.getDescription(), /* force= */ true, + /* fromUser= */ false, mWallpaper, /* reply= */ null); + } else { + success = bindWallpaperComponentLocked(mWallpaper.getComponent(), /* force= */ + true, /* fromUser= */false, mWallpaper, /* reply= */ null); + } + if (success) { mWallpaper.connection.scheduleTimeoutLocked(); } else if (SystemClock.uptimeMillis() - mWallpaper.lastDiedTime < WALLPAPER_RECONNECT_TIMEOUT_MS) { @@ -1189,7 +1196,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub // Timeout Slog.w(TAG, "Reverting to built-in wallpaper!"); clearWallpaperLocked(mWallpaper.mWhich, mWallpaper.userId, false, null); - final String flattened = wpService.flattenToString(); + final String flattened = mWallpaper.getComponent().flattenToString(); EventLog.writeEvent(EventLogTags.WP_WALLPAPER_CRASHED, flattened.substring(0, Math.min(flattened.length(), MAX_WALLPAPER_COMPONENT_LOG_LENGTH))); |