summaryrefslogtreecommitdiff
path: root/cmds/servicemanager/ServiceManager.h
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2023-01-28 02:50:00 +0000
committer Steven Moreland <smoreland@google.com> 2023-01-31 01:44:53 +0000
commit0db2addca8284f79cc5e9a4d97a1effa5142fe1e (patch)
tree5425bf2f79533fb5922dadd465a95f0c6d6f28a7 /cmds/servicemanager/ServiceManager.h
parent71216198dfcd8194cc4b32ad2ee7f3d3045ac67a (diff)
servicemanager: fix lazy service issues
Most of the issues here occured in a single thread, and they were due to inconsistent state in the state machine around clients, and it appears there were a lot of other things added which papered over these issues. I've marked explanations in more detail in the code itself. Bug: 264814573 Test: aidl_lazy_test in a loop at 500x speed by adjusting timings, running for an hour Change-Id: Ifa20a7214839a91543413d3c4ee2b0a24e0c3751
Diffstat (limited to 'cmds/servicemanager/ServiceManager.h')
-rw-r--r--cmds/servicemanager/ServiceManager.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds/servicemanager/ServiceManager.h b/cmds/servicemanager/ServiceManager.h
index f9d4f8fd90..3aa6731eb3 100644
--- a/cmds/servicemanager/ServiceManager.h
+++ b/cmds/servicemanager/ServiceManager.h
@@ -80,6 +80,8 @@ private:
// the number of clients of the service, including servicemanager itself
ssize_t getNodeStrongRefCount();
+
+ ~Service();
};
using ServiceCallbackMap = std::map<std::string, std::vector<sp<IServiceCallback>>>;
@@ -91,7 +93,9 @@ private:
void removeRegistrationCallback(const wp<IBinder>& who,
ServiceCallbackMap::iterator* it,
bool* found);
- ssize_t handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval);
+ // returns whether there are known clients in addition to the count provided
+ bool handleServiceClientCallback(size_t knownClients, const std::string& serviceName,
+ bool isCalledOnInterval);
// Also updates mHasClients (of what the last callback was)
void sendClientCallbackNotifications(const std::string& serviceName, bool hasClients,
const char* context);