Only clean the client if no pending intent exist.

Test: Presubmit

Bug: 239188851

Merged-In: I683ad404ffbd25359c795a72cc7620531d037197
Change-Id: If8b4e77182f49f322caf09da6dd7ea0d4aeb7de6
This commit is contained in:
Lei Ju
2022-07-18 11:05:57 -07:00
parent 3d8c880d4c
commit 1d2aa14abd

View File

@@ -871,10 +871,9 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
if (!mPendingIntentRequest.hasPendingIntent() && mRegistered) {
mClientManager.unregisterClient(mHostEndPointId);
mRegistered = false;
mAppOpsManager.stopWatchingMode(this);
mContextHubProxy.onHostEndpointDisconnected(mHostEndPointId);
}
mAppOpsManager.stopWatchingMode(this);
mContextHubProxy.onHostEndpointDisconnected(mHostEndPointId);
}
private String authStateToString(@ContextHubManager.AuthorizationState int state) {