summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hai Zhang <zhanghai@google.com> 2019-05-13 13:23:47 -0700
committer Hai Zhang <zhanghai@google.com> 2019-05-13 15:20:19 -0700
commita0e313a88917ce428924cc5deb5f573e69bef07f (patch)
treee890700077ac78c0a0b4dca82c89896f1e045645
parent895d5c546ca871cfb9e75c5eb13954fadb901c9a (diff)
Report request failure when binder died in remote service.
Or the caller could be waiting too long for a request that has already failed due to remote process crash. Bug: 132341999 Bug: 126266412 Test: atest CtsAutoFillServiceTestCases CtsContentCaptureServiceTestCases Change-Id: I014c8657ce247aed47335afb3144d88a0144e422
-rw-r--r--core/java/com/android/internal/infra/AbstractRemoteService.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/com/android/internal/infra/AbstractRemoteService.java b/core/java/com/android/internal/infra/AbstractRemoteService.java
index 64f885770336..3900f1674c13 100644
--- a/core/java/com/android/internal/infra/AbstractRemoteService.java
+++ b/core/java/com/android/internal/infra/AbstractRemoteService.java
@@ -231,6 +231,7 @@ public abstract class AbstractRemoteService<S extends AbstractRemoteService<S, I
@SuppressWarnings("unchecked") // TODO(b/117779333): fix this warning
final S castService = (S) this;
mVultureCallback.onServiceDied(castService);
+ handleBindFailure();
}
// Note: we are dumping without a lock held so this is a bit racy but
@@ -406,7 +407,8 @@ public abstract class AbstractRemoteService<S extends AbstractRemoteService<S, I
@NonNull BasePendingRequest<S, I> pendingRequest);
/**
- * Called if {@link Context#bindServiceAsUser} returns {@code false}.
+ * Called if {@link Context#bindServiceAsUser} returns {@code false}, or
+ * if {@link DeathRecipient#binderDied()} is called.
*/
abstract void handleBindFailure();
@@ -431,8 +433,6 @@ public abstract class AbstractRemoteService<S extends AbstractRemoteService<S, I
mBinding = false;
if (!mServiceDied) {
- // TODO(b/126266412): merge these 2 calls?
- handleBindFailure();
handleBinderDied();
}
}