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

Commit cdcf1617 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "A quick fix for fallback wallpaper connection NPE."

parents 4374ef85 78268c3b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -900,12 +900,21 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
        if (mLastWallpaper == null || mFallbackWallpaper == null) return;
        final WallpaperConnection systemConnection = mLastWallpaper.connection;
        final WallpaperConnection fallbackConnection = mFallbackWallpaper.connection;
        if (fallbackConnection == null) {
            Slog.w(TAG, "Fallback wallpaper connection has not been created yet!!");
            return;
        }
        if (supportsMultiDisplay(systemConnection)
                && fallbackConnection.getConnectedEngineSize() != 0) {
            fallbackConnection.forEachDisplayConnector(
                    WallpaperConnection.DisplayConnector::disconnectLocked);
            fallbackConnection.mDisplayConnector.clear();
        } else {
            // TODO(b/121181553) Handle wallpaper service disconnect case.
            if (fallbackConnection.mService == null) {
                Slog.w(TAG, "There is no fallback wallpaper service");
                return;
            }
            fallbackConnection.appendConnectorWithCondition(display ->
                    fallbackConnection.isUsableDisplay(display)
                            && display.getDisplayId() != DEFAULT_DISPLAY