diff options
| author | 2019-05-13 13:23:47 -0700 | |
|---|---|---|
| committer | 2019-05-13 15:20:19 -0700 | |
| commit | a0e313a88917ce428924cc5deb5f573e69bef07f (patch) | |
| tree | e890700077ac78c0a0b4dca82c89896f1e045645 | |
| parent | 895d5c546ca871cfb9e75c5eb13954fadb901c9a (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.java | 6 |
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(); } } |