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

Commit e3d2feaa authored by Keun young Park's avatar Keun young Park
Browse files

Fix wallpaper NPE caused by user switching before IWallpaperService connection

- car side is doing quick user switching during boot-up and that leads into
  wallpaper user switching before the service connection.
  user 0 start, user 0 unlock, user switch to user 10, boot complete, user 10 unlock

Bug: 129569939
Test: Try user switching flow in car env and confirm no crash
Change-Id: I764f68377ddf8b581f8386a236aa5c24a96368dd
parent de11a5ae
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2671,7 +2671,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                wallpaper.connection.mReply = null;
            }
            try {
                // It can be null if user switching happens before service connection.
                if (wallpaper.connection.mService != null) {
                    wallpaper.connection.mService.detach();
                }
            } catch (RemoteException e) {
                Slog.w(TAG, "Failed detaching wallpaper service ", e);
            }