summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2016-12-19 14:38:44 -0800
committer Christopher Tate <ctate@google.com> 2016-12-19 14:38:44 -0800
commit7cd0010df6314397939dac2cb54caa41fdd49d3c (patch)
treebdbf34cafce7cf932f1ae0098a2ba766876fd635
parent73dcab62b73f9eb49c179c6b8cf95a1385f3064a (diff)
Migrate system+lock wallpaper to lock-only when setting live wp
If the static imagery is shared between system+lock, preserve the lock presentation when setting a different system-surface live wallpaper. If the caller knows it wants to achieve system+lock display of the new live wallpaper, it follows up setWallpaperComponent() with an explicit clear of the lock wallpaper state. Previously, setting a new system live wallpaper would necessarily override a desired static lock image in the case of system+lock shared imagery. Now it doesn't. Bug 32664317 Change-Id: I7ef2cded534f9e6e91899db4c37bd24efaf09fee
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 372094001cf8..d7535bb82807 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -1563,6 +1563,19 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
throw new IllegalStateException("Wallpaper not yet initialized for user " + userId);
}
final long ident = Binder.clearCallingIdentity();
+
+ // Live wallpapers can't be specified for keyguard. If we're using a static
+ // system+lock image currently, migrate the system wallpaper to be a lock-only
+ // image as part of making a different live component active as the system
+ // wallpaper.
+ if (mImageWallpaper.equals(wallpaper.wallpaperComponent)) {
+ if (mLockWallpaperMap.get(userId) == null) {
+ // We're using the static imagery and there is no lock-specific image in place,
+ // therefore it's a shared system+lock image that we need to migrate.
+ migrateSystemToLockWallpaperLocked(userId);
+ }
+ }
+
try {
wallpaper.imageWallpaperPending = false;
if (bindWallpaperComponentLocked(name, false, true, wallpaper, null)) {