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

Commit 6b00c231 authored by David Lin's avatar David Lin
Browse files

audio: do not check for mode_in_communication for voip flags



This patch removes the unnecessary check conditions for
MODE_IN_COMMUNICATION and rely on the audiopolicymanager to set the voip
flags only for voice call based on stream types.

Bug: 62782025
Test: manual voip mo and mt calls tests
Change-Id: I7e22bc5c96c5429821cd4f4bade1acf6ba317ebc
Signed-off-by: default avatarDavid Lin <dtwlin@google.com>
parent e02448b3
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3687,9 +3687,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY;
        out->config = pcm_config_afe_proxy_playback;
        adev->voice_tx_output = out;
    } else if ((out->dev->mode == AUDIO_MODE_IN_COMMUNICATION) &&
               (out->flags == (AUDIO_OUTPUT_FLAG_DIRECT |
                               AUDIO_OUTPUT_FLAG_VOIP_RX))) {
    } else if (out->flags == (AUDIO_OUTPUT_FLAG_DIRECT |
                              AUDIO_OUTPUT_FLAG_VOIP_RX)) {
        uint32_t buffer_size, frame_size;
        out->supported_channel_masks[0] = AUDIO_CHANNEL_OUT_MONO;
        out->channel_mask = AUDIO_CHANNEL_OUT_MONO;
@@ -4348,7 +4347,6 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
            in->af_period_multiplier = 1;
            ALOGV("%s: USECASE_AUDIO_RECORD_MMAP", __func__);
        } else if (in->source == AUDIO_SOURCE_VOICE_COMMUNICATION &&
                   in->dev->mode == AUDIO_MODE_IN_COMMUNICATION &&
                   in->flags & AUDIO_INPUT_FLAG_VOIP_TX &&
                   (config->sample_rate == 8000 ||
                    config->sample_rate == 16000 ||