summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2020-04-08 00:52:51 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-04-08 00:52:51 +0000
commite5c824b24c8f217ef363557f548cef7ceeb2d097 (patch)
tree1c4a93a568c5e15c60acfa678554a9e67ede2d2d
parenta12af50c56376a6f73c9b03f46c514e28c1ef899 (diff)
parentc706c3ee8c4dad6c6baa369de37870383bcfb0c9 (diff)
Merge "Harder failures for lazy service clients."
-rw-r--r--libs/binder/LazyServiceRegistrar.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/binder/LazyServiceRegistrar.cpp b/libs/binder/LazyServiceRegistrar.cpp
index 74aece81f7..d4f26a1021 100644
--- a/libs/binder/LazyServiceRegistrar.cpp
+++ b/libs/binder/LazyServiceRegistrar.cpp
@@ -114,6 +114,12 @@ Status ClientCounterCallback::onClients(const sp<IBinder>& service, bool clients
mNumConnectedServices--;
}
+ // if this fails, we should switch this to keep track of clients inside
+ // of mRegisteredServices so that we know which service is double-counted.
+ LOG_ALWAYS_FATAL_IF(mNumConnectedServices > mRegisteredServices.size(),
+ "Invalid state: %zu services have clients, but we only know about %zu",
+ mNumConnectedServices, mRegisteredServices.size());
+
ALOGI("Process has %zu (of %zu available) client(s) in use after notification %s has clients: %d",
mNumConnectedServices, mRegisteredServices.size(),
String8(service->getInterfaceDescriptor()).string(), clients);