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

Commit 747c798e authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Chris Poultney
Browse files

Always rebind user-set wallpapers

setWallpaperDescription is only called from WallpaperManager APIs
directly. In this case, always rebind the wallpaper, even if the same
component is already set.

We keep the forceRebind internally for specific cases (for example,
after a clear(FLAG_LOCK), we want to move the HOME wallpaper to
HOME+LOCK, we do it via setWallpaperDescriptionInternal(force=false).

The COMMAND_REAPPLY will no longer be sent and should probably be
removed.

Test: atest WallpaperManagerTest
Flag: EXEMPT small change
Bug: 417165168
Want-Code-Review: all

Change-Id: I296b3e2d029e89eecdc5bf03d11715a750be741b
parent 89098f76
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -65,3 +65,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "always_rebind_user_set_wallpaper"
    namespace: "systemui"
    description: "Always rebind wallpapers after a change via WallpaperManager API"
    bug: "438411848"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREG
import static android.app.Flags.fixGetBitmapCrops;
import static android.app.Flags.notifyKeyguardEvents;
import static android.app.Flags.updateRecentsFromSystem;
import static android.app.Flags.alwaysRebindUserSetWallpaper;
import static android.app.WallpaperManager.COMMAND_REAPPLY;
import static android.app.WallpaperManager.FLAG_LOCK;
import static android.app.WallpaperManager.FLAG_SYSTEM;
@@ -3244,8 +3245,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
    boolean setWallpaperDescription(WallpaperDescription description, String callingPackage,
            @SetWallpaperFlags int which, int userId) {
        boolean fromForeground = isFromForegroundApp(callingPackage);
        return setWallpaperDescriptionInternal(description, which, userId, false, fromForeground,
                null);
        return setWallpaperDescriptionInternal(description, which, userId,
                alwaysRebindUserSetWallpaper(), fromForeground, null);
    }

    private boolean setWallpaperDescriptionInternal(@NonNull WallpaperDescription description,