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

Commit 32141dd7 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

aidl/ComponentStore: return error if listener is null.

Bug: 322760434
Test: presubmit
Change-Id: Ie22c22850b339c1d1b2e07cb9c32f53630aec827
parent edb2f14e
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -206,12 +206,19 @@ ScopedAStatus ComponentStore::createComponent(
        const std::shared_ptr<IClientManager>& pool,
        std::shared_ptr<IComponent> *component) {

    if (!listener) {
        ALOGE("createComponent(): listener is null");
        return ScopedAStatus::fromServiceSpecificError(Status::BAD_VALUE);
    }
    if (!pool) {
        ALOGE("createComponent(): pool is null");
        return ScopedAStatus::fromServiceSpecificError(Status::BAD_VALUE);
    }

    std::shared_ptr<C2Component> c2component;
    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);