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

Commit 8e60dbc2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "audio HAL wrapper: createAudioPatch handle reuse"

parents ce078623 8711cfda
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -322,6 +322,14 @@ status_t DeviceHalHidl::createAudioPatch(
        const struct audio_port_config *sinks,
        audio_patch_handle_t *patch) {
    if (mDevice == 0) return NO_INIT;
    if (patch == nullptr) return BAD_VALUE;

    if (*patch != AUDIO_PATCH_HANDLE_NONE) {
        status_t status = releaseAudioPatch(*patch);
        ALOGW_IF(status != NO_ERROR, "%s error %d releasing patch handle %d",
            __func__, status, *patch);
    }

    hidl_vec<AudioPortConfig> hidlSources, hidlSinks;
    HidlUtils::audioPortConfigsFromHal(num_sources, sources, &hidlSources);
    HidlUtils::audioPortConfigsFromHal(num_sinks, sinks, &hidlSinks);