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

Commit 9fd3d2f6 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Explicitly restart the killed wallpaper service" am: 0780b18a...

Merge "Merge "Explicitly restart the killed wallpaper service" am: 0780b18a am: 9298af37 am: c5d47474"
parents 0f67a6da 7d21b286
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -859,6 +859,17 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            }
        }

        public void scheduleTimeoutLocked() {
            // If we didn't reset it right away, do so after we couldn't connect to
            // it for an extended amount of time to avoid having a black wallpaper.
            final Handler fgHandler = FgThread.getHandler();
            fgHandler.removeCallbacks(mResetRunnable);
            fgHandler.postDelayed(mResetRunnable, WALLPAPER_RECONNECT_TIMEOUT_MS);
            if (DEBUG_LIVE) {
                Slog.i(TAG, "Started wallpaper reconnect timeout for " + mWallpaper.wallpaperComponent);
            }
        }

        private void processDisconnect(final ServiceConnection connection) {
            synchronized (mLock) {
                // The wallpaper disappeared.  If this isn't a system-default one, track
@@ -883,13 +894,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        } else {
                            mWallpaper.lastDiedTime = SystemClock.uptimeMillis();

                            // If we didn't reset it right away, do so after we couldn't connect to
                            // it for an extended amount of time to avoid having a black wallpaper.
                            final Handler fgHandler = FgThread.getHandler();
                            fgHandler.removeCallbacks(mResetRunnable);
                            fgHandler.postDelayed(mResetRunnable, WALLPAPER_RECONNECT_TIMEOUT_MS);
                            if (DEBUG_LIVE) {
                                Slog.i(TAG, "Started wallpaper reconnect timeout for " + wpService);
                            clearWallpaperComponentLocked(mWallpaper);
                            if (bindWallpaperComponentLocked(
                                    wpService, false, false, mWallpaper, null)) {
                                mWallpaper.connection.scheduleTimeoutLocked();
                            } else {
                                Slog.w(TAG, "Reverting to built-in wallpaper!");
                                clearWallpaperLocked(true, FLAG_SYSTEM, mWallpaper.userId, null);
                            }
                        }
                        final String flattened = wpService.flattenToString();