diff options
author | John Heroy <jheroy@google.com> | 2016-12-19 18:03:47 -0800 |
---|---|---|
committer | John Heroy <jheroy@google.com> | 2016-12-19 18:18:15 -0800 |
commit | 777ac7df694d3c2a0988e7bb960b35f8f942ab65 (patch) | |
tree | 6a05c67add8140e59c01c712fe2774b5c2e8ed92 | |
parent | 9e60e91d6a0a6a3c94149f38810d11568deb8cf5 (diff) | |
download | android_packages_wallpapers_LivePicker-777ac7df694d3c2a0988e7bb960b35f8f942ab65.tar.gz android_packages_wallpapers_LivePicker-777ac7df694d3c2a0988e7bb960b35f8f942ab65.tar.bz2 android_packages_wallpapers_LivePicker-777ac7df694d3c2a0988e7bb960b35f8f942ab65.zip |
Prompt wp destination when system imagery can migrate to lock.
WallpaperManager#setWallpaperComponent migrates system wallpaper imagery
to lock, so now LivePicker should ask for a live wallpaper destination
except when there's a live wallpaper set and there's no lock wallpaper
imagery.
Bug: 32670638
Fixed: 32670638
Test: Set a static wallpaper to system+lock, then try to set a live
wallpaper and observe that LivePicker prompts the user for a
destination.
Change-Id: I39767b592c5a91c06670d6d00af90069b5c8e353
-rw-r--r-- | src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java index f5bfce9..3991a5c 100644 --- a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java +++ b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java @@ -253,8 +253,11 @@ public class LiveWallpaperPreview extends Activity { } public void setLiveWallpaper(final View v) { - if (mWallpaperManager.getWallpaperId(WallpaperManager.FLAG_LOCK) < 0) { - // The lock screen does not have a wallpaper, so no need to prompt; can only set both. + if (mWallpaperManager.getWallpaperInfo() != null + && mWallpaperManager.getWallpaperId(WallpaperManager.FLAG_LOCK) < 0) { + // The lock screen does not have a distinct wallpaper and the current wallpaper is a + // live wallpaper, so since we cannot preserve any static imagery on the lock screen, + // set the live wallpaper directly without giving the user a destination option. try { setLiveWallpaper(v.getRootView().getWindowToken()); setResult(RESULT_OK); |