commit | 4b1b756d5df02e1401bec19f2288e82c94a481a2 | [log] [tgz] |
---|---|---|
author | Kunhung Li <kunhungli@google.com> | Fri Jun 12 10:07:38 2020 +0800 |
committer | Kunhung Li <kunhungli@google.com> | Fri Jun 12 03:54:32 2020 +0000 |
tree | 765d54ad853ab7494a93acc109c1e98a0ff03400 | |
parent | 6f62a9965f9559ebe20968e7f9aedea8b161a19b [diff] |
Fix live wallpaper stays on AOD mode After unlock the device, the live wallpaper status stay on AOD mode. WallpaperConnect does not disconnect while users existing wallpaper app by entering home or pressing back key. Disconnect WallpaperConnection in onStop(). Video: https://drive.google.com/file/d/13Ek4ZSyjNHeUcAv-nh9uT8daYHN4i7rm/view Bug: 158434793 Test: Manual Change-Id: I0eac6ff1bf6ba9be9d51987a330c1b1bd9c2bcd4
diff --git a/src/com/android/customization/picker/WallpaperPreviewer.java b/src/com/android/customization/picker/WallpaperPreviewer.java index c8b4bf2..03e7031 100644 --- a/src/com/android/customization/picker/WallpaperPreviewer.java +++ b/src/com/android/customization/picker/WallpaperPreviewer.java
@@ -89,6 +89,15 @@ } } + @OnLifecycleEvent(Lifecycle.Event.ON_STOP) + @MainThread + public void onStop() { + if (mWallpaperConnection != null) { + mWallpaperConnection.disconnect(); + mWallpaperConnection = null; + } + } + @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) @MainThread public void onDestroy() {