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

Commit 4e9c4061 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audio vts: Remove explicit dependency on the new types

Avoid using the new ChannelMaskSet and SampleRateSet types
directly to simplify upstreaming.

Bug: 141989952
Bug: 141847510
Test: atest VtsHalAudioV5_0TargetTest
Change-Id: I4477334be0375a95d79324a3ab38b03eb3f9998f
parent 9cd7668f
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -73,8 +73,11 @@ const std::vector<DeviceConfigParameter>& getOutputDeviceConfigParameters() {
                    getCachedPolicyConfig().getModuleFromName(std::get<PARAM_DEVICE_NAME>(device));
            for (const auto& ioProfile : module->getOutputProfiles()) {
                for (const auto& profile : ioProfile->getAudioProfiles()) {
                    auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(),
                                                                    profile->getSampleRates(),
                    const auto& channels = profile->getChannels();
                    const auto& sampleRates = profile->getSampleRates();
                    auto configs = ConfigHelper::combineAudioConfig(
                            vector<audio_channel_mask_t>(channels.begin(), channels.end()),
                            vector<uint32_t>(sampleRates.begin(), sampleRates.end()),
                            profile->getFormat());
                    auto flags = ioProfile->getFlags();
                    for (auto& config : configs) {
@@ -125,8 +128,11 @@ const std::vector<DeviceConfigParameter>& getInputDeviceConfigParameters() {
                    getCachedPolicyConfig().getModuleFromName(std::get<PARAM_DEVICE_NAME>(device));
            for (const auto& ioProfile : module->getInputProfiles()) {
                for (const auto& profile : ioProfile->getAudioProfiles()) {
                    auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(),
                                                                    profile->getSampleRates(),
                    const auto& channels = profile->getChannels();
                    const auto& sampleRates = profile->getSampleRates();
                    auto configs = ConfigHelper::combineAudioConfig(
                            vector<audio_channel_mask_t>(channels.begin(), channels.end()),
                            vector<uint32_t>(sampleRates.begin(), sampleRates.end()),
                            profile->getFormat());
                    for (const auto& config : configs) {
                        result.emplace_back(device, config, AudioInputFlag(ioProfile->getFlags()));
+2 −2
Original line number Diff line number Diff line
@@ -79,8 +79,8 @@ struct ConfigHelper {
        return {};
    }

    static vector<AudioConfig> combineAudioConfig(android::ChannelMaskSet channelMasks,
                                                  android::SampleRateSet sampleRates,
    static vector<AudioConfig> combineAudioConfig(vector<audio_channel_mask_t> channelMasks,
                                                  vector<uint32_t> sampleRates,
                                                  audio_format_t format) {
        vector<AudioConfig> configs;
        configs.reserve(channelMasks.size() * sampleRates.size());