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

Commit 4c61eaa3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

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

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2924778



Change-Id: Idca68286342b28187923b9c4d717b8f367c99286
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f09d8ad5 a23e18ec
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());