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

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

Merge "Fix problem where wrong colors would be picked"

parents feb1b59b 41f69424
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1262,14 +1262,23 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
        userId = ActivityManager.handleIncomingUser(Binder.getCallingPid(),
                Binder.getCallingUid(), userId, false, true, "clearWallpaper", null);

        WallpaperData data = null;
        synchronized (mLock) {
            clearWallpaperLocked(false, which, userId, null);

            if (which == FLAG_LOCK) {
                data = mLockWallpaperMap.get(userId);
            }
            if (which == FLAG_SYSTEM || data == null) {
                data = mWallpaperMap.get(userId);
            }
        }

        // When clearing a wallpaper, broadcast new valid colors
        WallpaperData data = getWallpaperSafeLocked(mCurrentUserId, which);
        if (data != null) {
            notifyWallpaperColorsChanged(data, which);
        }
    }

    void clearWallpaperLocked(boolean defaultFailed, int which, int userId, IRemoteCallback reply) {
        if (which != FLAG_SYSTEM && which != FLAG_LOCK) {