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

Commit c206441b authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Fix WallpaperManagerInternal NPE

Some targets don't have a WallpaperManager, thus this null check is
necessary to avoid crashes. A crash was detected in Android auto
emulator.

Fixes: 280883891
Test: build completed successfully
Change-Id: Ie475e9ba1999f109572252303e4103e5f977b4bd
parent b26be926
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3555,7 +3555,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                mRootWindowContainer.forAllDisplays(displayContent -> {
                    mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags);
                });
                getWallpaperManagerInternal().onKeyguardGoingAway();
                WallpaperManagerInternal wallpaperManagerInternal = getWallpaperManagerInternal();
                if (wallpaperManagerInternal != null) {
                    wallpaperManagerInternal.onKeyguardGoingAway();
                }
            }
        } finally {
            Binder.restoreCallingIdentity(token);