From bae23366656013f14af2b7de248d41b4251a2d9b Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 14 Dec 2020 23:18:30 +0000 Subject: [PATCH] HidlUtils: remove temporary conversion functions Remove temporary conversion functions and update the code that was using them. Bug: 142480271 Test: m Change-Id: Idf36dbac398efbc03bd6da68c79f6fb1ddc24e9c Merged-In: Idf36dbac398efbc03bd6da68c79f6fb1ddc24e9c --- audio/common/all-versions/default/HidlUtils.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/audio/common/all-versions/default/HidlUtils.h b/audio/common/all-versions/default/HidlUtils.h index c420a2f712..a0bd1bc27e 100644 --- a/audio/common/all-versions/default/HidlUtils.h +++ b/audio/common/all-versions/default/HidlUtils.h @@ -76,19 +76,7 @@ struct HidlUtils { const char* halDeviceAddress, DeviceAddress* device); #endif -#if MAJOR_VERSION <= 6 - // Temporary versions for compatibility with forks of the default implementation. - // Will be removed, do not use! - static status_t audioConfigFromHal(const audio_config_t& halConfig, AudioConfig* config) { - return audioConfigFromHal(halConfig, false /*isInput--ignored*/, config); - } - static std::unique_ptr audioPortConfigsToHal( - const hidl_vec& configs) { - std::unique_ptr halConfigs; - (void)audioPortConfigsToHal(configs, &halConfigs); - return halConfigs; - } -#else // V7 and above +#if MAJOR_VERSION >= 7 static status_t audioChannelMaskFromHal(audio_channel_mask_t halChannelMask, bool isInput, AudioChannelMask* channelMask); static status_t audioChannelMasksFromHal(const std::vector& halChannelMasks, @@ -138,7 +126,7 @@ struct HidlUtils { struct audio_port_config_device_ext* device, struct audio_port_config_mix_ext* mix, struct audio_port_config_session_ext* session); -#endif +#endif // MAJOR_VERSION >= 7 // V4 and below have DeviceAddress defined in the 'core' interface. // To avoid duplicating code, the implementations of deviceAddressTo/FromHal