policy_hal: avoid VOIP_RX flag is removed for voip call
When offload output starts with FLAG_DIRECT, then setup a
voip call, VOIP_RX flag will be overwritten to FLAG_NONE.
This causes voip usecase isn't set for voip call.
Fix by adding VOIP_RX flag check to avoid settting
FLAG_NONE for voip call.
Change-Id: Iee89d53d7529e6235b31903376b30e3a23657e3f
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index 8216fc8..d84ed16 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1701,7 +1701,8 @@
// prevent direct pcm for non-music stream blindly if direct pcm already in use
// for other music stream concurrency is handled after checking direct ouput usage
// and checking client
- if (direct_pcm_already_in_use == true && stream != AUDIO_STREAM_MUSIC) {
+ if (direct_pcm_already_in_use == true && stream != AUDIO_STREAM_MUSIC &&
+ !(*flags & AUDIO_OUTPUT_FLAG_VOIP_RX)) {
ALOGD("disabling offload for non music stream as direct pcm is already in use");
*flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_NONE);
}