diff options
author | Lucas Dupin <dupin@google.com> | 2017-06-26 12:19:12 -0700 |
---|---|---|
committer | Lucas Dupin <dupin@google.com> | 2017-07-06 12:49:24 -0700 |
commit | b989a5e9de2d0300c578e79705f670c2b7ffe199 (patch) | |
tree | 28c52dbf554491f88981694bcc963e0e36813dfb | |
parent | 21f3494cac8e7c58f49dfa9980e7e1edfaf834e8 (diff) | |
download | android_packages_wallpapers_LivePicker-b989a5e9de2d0300c578e79705f670c2b7ffe199.tar.gz android_packages_wallpapers_LivePicker-b989a5e9de2d0300c578e79705f670c2b7ffe199.tar.bz2 android_packages_wallpapers_LivePicker-b989a5e9de2d0300c578e79705f670c2b7ffe199.zip |
Avoid crash when unbinding wallpaper
A wallpaper service might have crashed before we try
to unbind it, in this case a runtime exception will
be thrown. Let's just ignore it since there is nothing
else to be done.
Bug: 62828614
Test: manually set Windy wallpaper and resize it
Change-Id: If9882ea27aaf3c92d2069ae6c8ef409c6ae2fa91
-rw-r--r-- | src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java index baaa13c..6dab5c6 100644 --- a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java +++ b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java @@ -439,7 +439,12 @@ public class LiveWallpaperPreview extends Activity { } mEngine = null; } - unbindService(this); + try { + unbindService(this); + } catch (IllegalArgumentException e) { + Log.w(LOG_TAG, "Can't unbind wallpaper service. " + + "It might have crashed, just ignoring.", e); + } mService = null; } } @@ -485,7 +490,7 @@ public class LiveWallpaperPreview extends Activity { } } } - + public ParcelFileDescriptor setWallpaper(String name) { return null; } |