diff options
| author | 2020-03-16 23:51:17 +0000 | |
|---|---|---|
| committer | 2020-03-16 23:51:17 +0000 | |
| commit | 76eb4acf8a545bb7097c534b1f2ceaa3a3577b11 (patch) | |
| tree | e4e24bf5d7bc7180d1a1b1f04f4dc02a167fd4fe /cmds/servicemanager/ServiceManager.cpp | |
| parent | ee8a6890091b11c9562786828605ca4758186be9 (diff) | |
| parent | cbe953924c36191d1dea16e591ce70f24a763a26 (diff) | |
Merge "ServiceManager: Check guaranteeClient before unregistering services" am: cbe953924c
Change-Id: I9d40aa47a342f9a81cec9018a46ef4cc29730a4f
Diffstat (limited to 'cmds/servicemanager/ServiceManager.cpp')
| -rw-r--r-- | cmds/servicemanager/ServiceManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp index 1e88aaf63b..cbbea128a6 100644 --- a/cmds/servicemanager/ServiceManager.cpp +++ b/cmds/servicemanager/ServiceManager.cpp @@ -522,6 +522,11 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); } + if (serviceIt->second.guaranteeClient) { + LOG(INFO) << "Tried to unregister " << name << ", but there is about to be a client."; + return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); + } + int clients = handleServiceClientCallback(name, false); // clients < 0: feature not implemented or other error. Assume clients. |