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

Commit 8cde0798 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Add preloading wallpaper to the getWallpaper call.

Otherwise, there is no way to get a wallpaper for
the user that was never loaded.

Bug: 25185253
Change-Id: I88df266f6af7ca78ebc30d78e82e1df3ab09a3c5
parent dcd93cc2
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -1087,20 +1087,18 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
        }

        synchronized (mLock) {
            WallpaperData wallpaper = null;
            if (which == FLAG_SET_LOCK) {
                wallpaper = mLockWallpaperMap.get(wallpaperUserId);
            final SparseArray<WallpaperData> whichSet =
                    (which == FLAG_SET_LOCK) ? mLockWallpaperMap : mWallpaperMap;
            WallpaperData wallpaper = whichSet.get(wallpaperUserId);
            if (wallpaper == null) {
                    // If you ask for the lock wallpaper specifically and there isn't one,
                    // we say so rather than returning the system wallpaper as fallback.
                    return null;
                }
            } else {
                wallpaper = mWallpaperMap.get(wallpaperUserId);
            }
                // common case, this is the first lookup post-boot of the system or
                // unified lock, so we bring up the saved state lazily now and recheck.
                loadSettingsLocked(wallpaperUserId);
                wallpaper = whichSet.get(wallpaperUserId);
                if (wallpaper == null) {
                    return null;
                }
            }
            try {
                if (outParams != null) {
                    outParams.putInt("width", wallpaper.width);