Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b23d0042 authored by Chris Poultney's avatar Chris Poultney
Browse files

Fix missing wallpaper description on live wallpaper rebind

Fixes: 398055849
Test: manually tested
Flag: EXEMPT bugfix
Change-Id: I6a50c85c3b55a972b6c3136e263351b87481a7fa
parent 33746bcb
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -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)));