diff options
| author | 2023-07-27 15:08:34 +0000 | |
|---|---|---|
| committer | 2023-07-27 15:08:34 +0000 | |
| commit | 651440d116179eb4d7bdf82bd2c0d988a216ac8c (patch) | |
| tree | ed0db2dfe8037b15f086799f0bebf7839aa0cab5 | |
| parent | 076a75f35cc658eb8730aff1fa3ac8a85945907d (diff) | |
| parent | 078e715cd4a7c5dfe22aab9322214d8372a8884e (diff) | |
Merge "Clear DreamOverlayCallback reference on destroy." into udc-qpr-dev
| -rw-r--r-- | core/java/android/service/dreams/DreamService.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java index 9b19937444bd..7d9c0a37a13f 100644 --- a/core/java/android/service/dreams/DreamService.java +++ b/core/java/android/service/dreams/DreamService.java @@ -244,13 +244,7 @@ public class DreamService extends Service implements Window.Callback { private DreamOverlayConnectionHandler mOverlayConnection; - private final IDreamOverlayCallback mOverlayCallback = new IDreamOverlayCallback.Stub() { - @Override - public void onExitRequested() { - // Simply finish dream when exit is requested. - mHandler.post(() -> finish()); - } - }; + private IDreamOverlayCallback mOverlayCallback; public DreamService() { @@ -877,6 +871,13 @@ public class DreamService extends Service implements Window.Callback { mDreamComponent = new ComponentName(this, getClass()); mShouldShowComplications = fetchShouldShowComplications(this /*context*/, fetchServiceInfo(this /*context*/, mDreamComponent)); + mOverlayCallback = new IDreamOverlayCallback.Stub() { + @Override + public void onExitRequested() { + // Simply finish dream when exit is requested. + mHandler.post(() -> finish()); + } + }; super.onCreate(); } @@ -1083,7 +1084,7 @@ public class DreamService extends Service implements Window.Callback { // Just in case destroy came in before detach, let's take care of that now detach(); - + mOverlayCallback = null; super.onDestroy(); } |