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

Commit b7966f9f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add extra null-checks to WallpaperManagerService." into sc-dev

parents a553d62c fdd50fb1
Loading
Loading
Loading
Loading
+25 −20
Original line number Diff line number Diff line
@@ -2384,6 +2384,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
    public void notifyWakingUp(int x, int y, @NonNull Bundle extras) {
        synchronized (mLock) {
            final WallpaperData data = mWallpaperMap.get(mCurrentUserId);
            if (data != null && data.connection != null) {
                data.connection.forEachDisplayConnector(
                        displayConnector -> {
                            if (displayConnector.mEngine != null) {
@@ -2397,6 +2398,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        });
            }
        }
    }

    /**
     * Propagate a sleep event to the wallpaper engine.
@@ -2404,12 +2406,14 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
    public void notifyGoingToSleep(int x, int y, @NonNull Bundle extras) {
        synchronized (mLock) {
            final WallpaperData data = mWallpaperMap.get(mCurrentUserId);
            if (data != null && data.connection != null) {
                data.connection.forEachDisplayConnector(
                        displayConnector -> {
                            if (displayConnector.mEngine != null) {
                                try {
                                    displayConnector.mEngine.dispatchWallpaperCommand(
                                        WallpaperManager.COMMAND_GOING_TO_SLEEP, x, y, -1, extras);
                                            WallpaperManager.COMMAND_GOING_TO_SLEEP, x, y, -1,
                                            extras);
                                } catch (RemoteException e) {
                                    e.printStackTrace();
                                }
@@ -2417,6 +2421,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        });
            }
        }
    }

    @Override
    public boolean setLockWallpaperCallback(IWallpaperManagerCallback cb) {