OSDN Git Service

Fix live wallpaper not showing on lock screen after restore
authorBryan Mawhinney <bryanmawhinney@google.com>
Tue, 7 Feb 2017 15:27:19 +0000 (15:27 +0000)
committerBryan Mawhinney <bryanmawhinney@google.com>
Tue, 7 Feb 2017 15:37:40 +0000 (15:37 +0000)
A recent change in nyc-mr2 means that setWallpaperComponent will
promote any static system wallpaper to the lock screen.  If we don't
actually have a static lock wallpaper to restore, we need to explicitly
clear the lock wallpaper to have the live one show through

Test: manually using adb backup / restore
Bug: 35090402
Change-Id: I8a2c5ffbaefe172c9d78a9f746ab87d9bc6b7448

packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java

index 19da32c..4254a0b 100644 (file)
@@ -230,6 +230,11 @@ public class WallpaperBackupAgent extends BackupAgent {
                     Slog.i(TAG, "Using wallpaper service " + wpService);
                 }
                 mWm.setWallpaperComponent(wpService, UserHandle.USER_SYSTEM);
+                if (!lockImageStage.exists()) {
+                    // We have a live wallpaper and no static lock image,
+                    // allow live wallpaper to show "through" on lock screen.
+                    mWm.clear(FLAG_LOCK);
+                }
             } else {
                 if (DEBUG) {
                     Slog.v(TAG, "Can't use wallpaper service " + wpService);