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

Commit a39f7f0e authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by android-build-merger
Browse files

Merge "audiopolicy: add null pointer check for primary hw"

am: 3e9dd76e

Change-Id: I45ad57a48356a061ed52fa7c9a46af2d24157e50
parents bacbbf5a 3e9dd76e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -472,6 +472,10 @@ status_t AudioPolicyManager::getHwOffloadEncodingFormatsSupportedForA2DP(
    std::unordered_set<audio_format_t> formatSet;
    sp<HwModule> primaryModule =
            mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_PRIMARY);
    if (primaryModule == nullptr) {
        ALOGE("%s() unable to get primary module", __func__);
        return NO_INIT;
    }
    DeviceVector declaredDevices = primaryModule->getDeclaredDevices().getDevicesFromTypeMask(
            AUDIO_DEVICE_OUT_ALL_A2DP);
    for (const auto& device : declaredDevices) {