Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 152566b5 authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "servicemanager: rely on auto unlinkToDeath" into stage-aosp-master am:...

Merge "servicemanager: rely on auto unlinkToDeath" into stage-aosp-master am: f8819416 am: d09f7fae am: 18f2ebbd
am: 4b8b5f12

Change-Id: I1a440b5b020237a9d2e568b2ca3b41b621f7e143
parents 39a16964 4b8b5f12
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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,