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

Commit e1f33906 authored by Vlad Popa's avatar Vlad Popa
Browse files

CSD: fix crash when HAL returns null sound dose itf

This is allowed as defined in the HAL documentation. Adding extra check
when retrieving the sound dose interface.

Test: trivial fix
Bug: 308045706
Change-Id: I0b5611fd3df39b4230dde3bf31596b96e944b571
parent 781fbcbd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,14 @@ status_t DeviceHalAidl::getSoundDoseInterface(const std::string& module,
            return BAD_VALUE;
        }
    }

    if (mSoundDose == nullptr) {
        ALOGE("%s failed to return the sound dose interface for module %s: not implemented",
                  __func__,
                  module.c_str());
        return NO_INIT;
    }

    *soundDoseBinder = mSoundDose->asBinder();
    ALOGI("%s using audio AIDL HAL sound dose interface", __func__);