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

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

Fix getWallpaperSafeLocked

The first time this method is called for a system-only wallpaper, if the
lock wallpaper is not loaded yet, it will not be aware of the lock
wallpaper and will think that the system wallpaper is sys+lock.

This happens after a reboot + user switch when the secondary user have
two different wallpapers.

This may fix other cases where the lock screen wallpaper is set to same
as home screen

Bug: 300537586
Test: atest WallpaperManagerTest
Test: manually check that the bug is fixed
Change-Id: Ib37f83233deac7198997910991ffcce75b357aae
parent c130813d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3982,7 +3982,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
        if (wallpaper == null) {
            // 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.
            int whichLoad = (which == FLAG_LOCK) ? FLAG_LOCK : FLAG_SYSTEM;
            // if we're loading the system wallpaper for the first time, also load the lock
            // wallpaper to determine if the system wallpaper is system+lock or system only.
            int whichLoad = (which == FLAG_LOCK) ? FLAG_LOCK : FLAG_SYSTEM | FLAG_LOCK;
            loadSettingsLocked(userId, false, whichLoad);
            wallpaper = whichSet.get(userId);
            if (wallpaper == null) {