diff options
author | Mikhail Naganov <mnaganov@google.com> | 2020-10-29 13:08:05 -0700 |
---|---|---|
committer | Mikhail Naganov <mnaganov@google.com> | 2020-12-11 22:10:10 +0000 |
commit | 1b444a53324d51e8451000901863e8629a631729 (patch) | |
tree | 81c471d190ddf21d6d3e0ee4f0d0a06d4aab5b42 /audio/core/all-versions/default/Device.cpp | |
parent | 4122f6328a94572d69f9d0e917a8ebe6e70d1630 (diff) |
Implement a.h.audio.common@7.0-util module
This includes a rewrite of HidlUtils for V7.
A unit test is added for its conversion functions.
Made necessary minor adjustments to the HAL V7 types.
Also, fixed definition of 'audioFormatsList' to allow for
vendor extensions.
Bug: 142480271
Bug: 173647783
Test: m && atest android.hardware.audio.common@7.0-util_tests
Change-Id: Ib883f1c246fce78c004846516699aa724d4b5d44
Merged-In: Ib883f1c246fce78c004846516699aa724d4b5d44
Diffstat (limited to 'audio/core/all-versions/default/Device.cpp')
-rw-r--r-- | audio/core/all-versions/default/Device.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp index 6260ba1979..3c28159816 100644 --- a/audio/core/all-versions/default/Device.cpp +++ b/audio/core/all-versions/default/Device.cpp @@ -283,8 +283,10 @@ std::tuple<Result, AudioPatchHandle> Device::createOrUpdateAudioPatch( const hidl_vec<AudioPortConfig>& sinks) { Result retval(Result::NOT_SUPPORTED); if (version() >= AUDIO_DEVICE_API_VERSION_3_0) { - std::unique_ptr<audio_port_config[]> halSources(HidlUtils::audioPortConfigsToHal(sources)); - std::unique_ptr<audio_port_config[]> halSinks(HidlUtils::audioPortConfigsToHal(sinks)); + std::unique_ptr<audio_port_config[]> halSources; + HidlUtils::audioPortConfigsToHal(sources, &halSources); + std::unique_ptr<audio_port_config[]> halSinks; + HidlUtils::audioPortConfigsToHal(sinks, &halSinks); audio_patch_handle_t halPatch = static_cast<audio_patch_handle_t>(patch); retval = analyzeStatus("create_audio_patch", mDevice->create_audio_patch(mDevice, sources.size(), &halSources[0], |