policy_hal: do not check MODE_IN_COMMUNICATION for voip_rx flag
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
Commit: 72ad4b91d6ece44b7967080c44695227c6789147
Change-Id: Idc7e1b6f33921580c0937dee71b2b2105cbd31eb
CRs-Fixed: 2399711
Change-Id: I68b9204210a857cf78e9b7467671cd8013a3d789
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index c34f86d..13a2a4b 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1408,8 +1408,7 @@
}
if (mApmConfigs->isCompressVOIPEnabled()) {
- if ((mEngine->getPhoneState() == AUDIO_MODE_IN_COMMUNICATION) &&
- (stream == AUDIO_STREAM_VOICE_CALL) &&
+ if (stream == AUDIO_STREAM_VOICE_CALL &&
audio_is_linear_pcm(config->format)) {
// let voice stream to go with primary output by default
// in case direct voip is bypassed
@@ -1456,8 +1455,7 @@
}
}
} else {
- if (mEngine->getPhoneState() == AUDIO_MODE_IN_COMMUNICATION &&
- stream == AUDIO_STREAM_VOICE_CALL &&
+ if (stream == AUDIO_STREAM_VOICE_CALL &&
audio_is_linear_pcm(config->format)) {
//check if VoIP output is not opened already
bool voip_pcm_already_in_use = false;