summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Salo <asalo@google.com> 2019-04-02 18:45:20 -0700
committer Alex Salo <asalo@google.com> 2019-04-02 18:45:20 -0700
commit10800341e6dc7de187836cf2655d0ac65fdec02c (patch)
tree6b6ae549dad506d1b5515372780f6a7582f904eb
parentec35d666c16d4dffd5e9a0375b808da8e451ff77 (diff)
Notify caller about cancellation
In an event when service disconnected we clear the pending callback. Don't forget to cancel it and notify the caller. Bug: 129348179 Test: manually Change-Id: Iaf3d44df9bbee4b31ae3aa680351f1cdd7f0ef96
-rw-r--r--services/core/java/com/android/server/attention/AttentionManagerService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/attention/AttentionManagerService.java b/services/core/java/com/android/server/attention/AttentionManagerService.java
index 1681c5bc61d3..bc78d1ad751f 100644
--- a/services/core/java/com/android/server/attention/AttentionManagerService.java
+++ b/services/core/java/com/android/server/attention/AttentionManagerService.java
@@ -19,6 +19,7 @@ package com.android.server.attention;
import static android.provider.DeviceConfig.NAMESPACE_ATTENTION_MANAGER_SERVICE;
import static android.provider.Settings.System.ADAPTIVE_SLEEP;
import static android.service.attention.AttentionService.ATTENTION_FAILURE_CANCELLED;
+import static android.service.attention.AttentionService.ATTENTION_FAILURE_UNKNOWN;
import android.Manifest;
import android.annotation.NonNull;
@@ -249,6 +250,7 @@ public class AttentionManagerService extends SystemService {
if (userState.mPendingAttentionCheck != null
&& userState.mPendingAttentionCheck.mCallbackInternal.equals(
callbackInternal)) {
+ userState.mPendingAttentionCheck.cancel(ATTENTION_FAILURE_UNKNOWN);
userState.mPendingAttentionCheck = null;
}
return;
@@ -624,7 +626,7 @@ public class AttentionManagerService extends SystemService {
if (userState == null) {
return;
}
- cancel(userState, AttentionService.ATTENTION_FAILURE_UNKNOWN);
+ cancel(userState, ATTENTION_FAILURE_UNKNOWN);
mContext.unbindService(userState.mConnection);
userState.mConnection.cleanupService();