diff options
| -rw-r--r-- | cmds/servicemanager/ServiceManager.cpp | 8 | 
1 files changed, 1 insertions, 7 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp index 5f7dc25d59..f35f360dec 100644 --- a/cmds/servicemanager/ServiceManager.cpp +++ b/cmds/servicemanager/ServiceManager.cpp @@ -98,18 +98,12 @@ Status ServiceManager::addService(const std::string& name, const sp<IBinder>& bi          return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT);      } +    // implicitly unlinked when the binder is removed      if (OK != binder->linkToDeath(this)) {          LOG(ERROR) << "Could not linkToDeath when adding " << name;          return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE);      } -    auto it = mNameToService.find(name); -    if (it != mNameToService.end()) { -        if (OK != it->second.binder->unlinkToDeath(this)) { -            LOG(WARNING) << "Could not unlinkToDeath when adding " << name; -        } -    } -      mNameToService[name] = Service {          .binder = binder,          .allowIsolated = allowIsolated,  |