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

Commit 3e9dd76e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents b5ba1eb0 5b023ebc
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) {