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

Commit 72ad4b91 authored by David Lin's avatar David Lin
Browse files

audiopolicy: do not check for mode_in_communication for voip flags



Some VoIP clients may choose to open the streams as soon as the phone
state is set to MODE_RINGTONE to allow lower start latency when the call
is connected. This patch removes the unnecessary check conditions for
MODE_IN_COMMUNICATION since the stream type is sufficient indicator for
setting the flags for VoIP calls.

Bug: 62782025
Test: manual voip mo and mt calls tests
Change-Id: Idc7e1b6f33921580c0937dee71b2b2105cbd31eb
Signed-off-by: default avatarDavid Lin <dtwlin@google.com>
parent db5beef4
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -933,7 +933,6 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
    if (stream == AUDIO_STREAM_TTS) {
        flags = AUDIO_OUTPUT_FLAG_TTS;
    } else if (stream == AUDIO_STREAM_VOICE_CALL &&
               getPhoneState() == AUDIO_MODE_IN_COMMUNICATION &&
               audio_is_linear_pcm(format)) {
        flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_VOIP_RX |
                                       AUDIO_OUTPUT_FLAG_DIRECT);
@@ -1647,7 +1646,6 @@ audio_io_handle_t AudioPolicyManager::getInputForDevice(audio_devices_t device,
            halInputSource = AUDIO_SOURCE_VOICE_RECOGNITION;
        }
    } else if (inputSource == AUDIO_SOURCE_VOICE_COMMUNICATION &&
               getPhoneState() == AUDIO_MODE_IN_COMMUNICATION &&
               audio_is_linear_pcm(format)) {
        flags = (audio_input_flags_t)(flags | AUDIO_INPUT_FLAG_VOIP_TX);
    }