Merge "Clear DreamOverlayCallback reference on destroy." into udc-qpr-dev
This commit is contained in:
@@ -244,13 +244,7 @@ public class DreamService extends Service implements Window.Callback {
|
|||||||
|
|
||||||
private DreamOverlayConnectionHandler mOverlayConnection;
|
private DreamOverlayConnectionHandler mOverlayConnection;
|
||||||
|
|
||||||
private final IDreamOverlayCallback mOverlayCallback = new IDreamOverlayCallback.Stub() {
|
private IDreamOverlayCallback mOverlayCallback;
|
||||||
@Override
|
|
||||||
public void onExitRequested() {
|
|
||||||
// Simply finish dream when exit is requested.
|
|
||||||
mHandler.post(() -> finish());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public DreamService() {
|
public DreamService() {
|
||||||
@@ -877,6 +871,13 @@ public class DreamService extends Service implements Window.Callback {
|
|||||||
mDreamComponent = new ComponentName(this, getClass());
|
mDreamComponent = new ComponentName(this, getClass());
|
||||||
mShouldShowComplications = fetchShouldShowComplications(this /*context*/,
|
mShouldShowComplications = fetchShouldShowComplications(this /*context*/,
|
||||||
fetchServiceInfo(this /*context*/, mDreamComponent));
|
fetchServiceInfo(this /*context*/, mDreamComponent));
|
||||||
|
mOverlayCallback = new IDreamOverlayCallback.Stub() {
|
||||||
|
@Override
|
||||||
|
public void onExitRequested() {
|
||||||
|
// Simply finish dream when exit is requested.
|
||||||
|
mHandler.post(() -> finish());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
super.onCreate();
|
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
|
// Just in case destroy came in before detach, let's take care of that now
|
||||||
detach();
|
detach();
|
||||||
|
mOverlayCallback = null;
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user