summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2023-03-07 10:55:56 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-03-07 10:55:56 +0000
commit2fe9d01c217dacdd36937e3d8e36f93b967bfa83 (patch)
tree7993d6d8a4353c6e1de5da1d59c1d96165231aa0
parentda200cce14bfb190c131b46012e09416158740db (diff)
parentf6a2db4484d9458f0f5363b1e3082f5fcc5a35fa (diff)
Merge "servicemanager: -= clients log spam" am: 896febc017 am: 9384d621e9 am: f6a2db4484
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2471754 Change-Id: I8df00557c4726fb98dad9ae411ff36aec333f961 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--cmds/servicemanager/ServiceManager.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp
index 07809e21f4..4da0cd6897 100644
--- a/cmds/servicemanager/ServiceManager.cpp
+++ b/cmds/servicemanager/ServiceManager.cpp
@@ -228,8 +228,13 @@ static bool meetsDeclarationRequirements(const sp<IBinder>& binder, const std::s
#endif // !VENDORSERVICEMANAGER
ServiceManager::Service::~Service() {
- if (!hasClients) {
- // only expected to happen on process death
+ if (hasClients) {
+ // only expected to happen on process death, we don't store the service
+ // name this late (it's in the map that holds this service), but if it
+ // is happening, we might want to change 'unlinkToDeath' to explicitly
+ // clear this bit so that we can abort in other cases, where it would
+ // mean inconsistent logic in servicemanager (unexpected and tested, but
+ // the original lazy service impl here had that bug).
LOG(WARNING) << "a service was removed when there are clients";
}
}