policy_hal: avoid unnecessary voip and direct flags setting
When new voip call started with another voip call working,
direct output is closed/opened repeatedly because both voip
call are trying to acquire direct output.
Avoid setting unnecessary voip and direct flags when voip
output is in use.
CRs-Fixed: 2338187
Change-Id: I01255afb011bf1bdaa43bb83f1ab8874234201f7
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index 2806284..cc77b78 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1693,11 +1693,6 @@
if (stream == AUDIO_STREAM_TTS) {
*flags = AUDIO_OUTPUT_FLAG_TTS;
- } else if (stream == AUDIO_STREAM_VOICE_CALL &&
- audio_is_linear_pcm(config->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");
} else if (devices.types() == AUDIO_DEVICE_OUT_TELEPHONY_TX &&
stream == AUDIO_STREAM_MUSIC &&
audio_is_linear_pcm(config->format) &&