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

Commit 50410e44 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "media.c2 aidl: Check mListener is not null for Component" into main

parents a35bfa16 785294e3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ struct Component::Listener : public C2Component::Listener {
    Listener(const std::shared_ptr<Component>& component) :
            mComponent(component),
            mListener(component->mListener) {
        CHECK(component);
        CHECK(component->mListener);
    }

    virtual void onError_nb(
@@ -420,6 +422,8 @@ void Component::initListener(const std::shared_ptr<Component>& self) {
            mInit = res;
        }

        // b/321902635, mListener should not be null.
        CHECK(mListener);
        mDeathRecipient = ::ndk::ScopedAIBinder_DeathRecipient(
                AIBinder_DeathRecipient_new(OnBinderDied));
        mDeathContext = new DeathContext{ref<Component>()};
+4 −1
Original line number Diff line number Diff line
@@ -210,6 +210,8 @@ ScopedAStatus ComponentStore::createComponent(
    c2_status_t status =
            mStore->createComponent(name, &c2component);

    ALOGD("createComponent(): listener(%d)", bool(listener));

    if (status == C2_OK) {
#ifndef __ANDROID_APEX__
        c2component = GetFilterWrapper()->maybeWrapComponent(c2component);
@@ -218,7 +220,8 @@ ScopedAStatus ComponentStore::createComponent(
        std::shared_ptr<Component> comp =
            SharedRefBase::make<Component>(c2component, listener, ref<ComponentStore>(), pool);
        *component = comp;
        if (!component) {
        if (!component || !comp) {
            ALOGE("createComponent(): component cannot be returned");
            status = C2_CORRUPTED;
        } else {
            reportComponentBirth(comp.get());