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

Commit 84c621e9 authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Eric Laurent
Browse files

APM: Check dedicated VOIP downlink profile

Check and select a dedicated VOIP downlink profile if available.

Test: verify Hangouts call audio

Change-Id: I7ef32a0e159f42c20ce5fb8ccc3548f3856a15cb
parent 64892d86
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -706,7 +706,8 @@ sp<IOProfile> AudioPolicyManager::getProfileForDirectOutput(
    // only retain flags that will drive the direct output profile selection
    // if explicitly requested
    static const uint32_t kRelevantFlags =
            (AUDIO_OUTPUT_FLAG_HW_AV_SYNC | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD);
            (AUDIO_OUTPUT_FLAG_HW_AV_SYNC | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD |
             AUDIO_OUTPUT_FLAG_VOIP_RX);
    flags =
        (audio_output_flags_t)((flags & kRelevantFlags) | AUDIO_OUTPUT_FLAG_DIRECT);

@@ -922,6 +923,12 @@ 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);
        ALOGV("Set VoIP and Direct output flags for PCM format");
    }

    sp<IOProfile> profile;