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

Commit 20919490 authored by Nadav Bar's avatar Nadav Bar
Browse files

Support playing to uplink stream using the VOICE_CALL stream as well

Added support for playing audio to the uplink stream also using the
VOICE_CALL stream. This will ensure the uplink playback have the same
characteristics as other audio which is being played back during a call,
and can by pass the DND mute.

Change-Id: I1830bebb5fca724de561fbde8445fcee95f9c930
Test: tested manually.
Bug: 117866278.
parent 9a4f4c23
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -840,8 +840,9 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
    // chosen by the engine if not.
    // FIXME: provide a more generic approach which is not device specific and move this back
    // to getOutputForDevice.
    // TODO: Remove check of AUDIO_STREAM_MUSIC once migration is completed on the app side.
    if (device == AUDIO_DEVICE_OUT_TELEPHONY_TX &&
        *stream == AUDIO_STREAM_MUSIC &&
        (*stream == AUDIO_STREAM_MUSIC || attributes.usage == AUDIO_USAGE_VOICE_COMMUNICATION) &&
        audio_is_linear_pcm(config->format) &&
        isInCall()) {
        if (requestedDeviceId != AUDIO_PORT_HANDLE_NONE) {
@@ -930,7 +931,8 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
    if (stream == AUDIO_STREAM_TTS) {
        *flags = AUDIO_OUTPUT_FLAG_TTS;
    } else if (stream == AUDIO_STREAM_VOICE_CALL &&
               audio_is_linear_pcm(config->format)) {
               audio_is_linear_pcm(config->format) &&
               (*flags & AUDIO_OUTPUT_FLAG_INCALL_MUSIC) == 0) {
        *flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_VOIP_RX |
                                       AUDIO_OUTPUT_FLAG_DIRECT);
        ALOGV("Set VoIP and Direct output flags for PCM format");