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

Commit be88ec9e authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android Build Coastguard Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:58e3cfe430ed60bd4bb56117824d6736831562ef)
Merged-In: Ib37f83233deac7198997910991ffcce75b357aae
Change-Id: Ib37f83233deac7198997910991ffcce75b357aae
parent fbceacb9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3906,7 +3906,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) {