summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kalauskas <peskal@google.com>2020-06-24 23:08:46 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-24 23:08:46 +0000
commit9ed41f25fd3be8b51fd31b5d0c1223c754d437c4 (patch)
tree4a0265ca7aaa935b2587f71a3d03f40e22c0ae17
parentb487a5ad7ff05161fdd19f51cf7d8bceca3e0801 (diff)
parent528f369a79138a0066b1d42aec3e80f1f850fb51 (diff)
downloadhwservicemanager-android11-qpr1-c-release.tar.gz
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/hwservicemanager/+/11990970 Change-Id: I66dcf6c543e4026ae764eeb9d649b4acc011f44f
-rw-r--r--ServiceManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ServiceManager.cpp b/ServiceManager.cpp
index 165a8d9..85d4974 100644
--- a/ServiceManager.cpp
+++ b/ServiceManager.cpp
@@ -284,6 +284,12 @@ Return<sp<IBase>> ServiceManager::get(const hidl_string& hidlFqName,
// Let HidlService know that we handed out a client. If the client drops the service before the
// next time handleClientCallbacks is called, it will still know that the service had been handed out.
hidlService->guaranteeClient();
+ forEachExistingService([&] (HidlService *otherService) {
+ if (otherService != hidlService && interfacesEqual(service, otherService->getService())) {
+ otherService->guaranteeClient();
+ }
+ return true;
+ });
// This is executed immediately after the binder driver confirms the transaction. The driver
// will update the appropriate data structures to reflect the fact that the client now has the