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

Commit 18f2ebbd 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: f8819416

am: d09f7fae

Change-Id: I3007860fee271305e648fc156a04967a58622dfd
parents b6cb4068 d09f7fae
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line 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);
        return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT);
    }
    }


    // implicitly unlinked when the binder is removed
    if (OK != binder->linkToDeath(this)) {
    if (OK != binder->linkToDeath(this)) {
        LOG(ERROR) << "Could not linkToDeath when adding " << name;
        LOG(ERROR) << "Could not linkToDeath when adding " << name;
        return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE);
        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 {
    mNameToService[name] = Service {
        .binder = binder,
        .binder = binder,
        .allowIsolated = allowIsolated,
        .allowIsolated = allowIsolated,