diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c index 2c3106f1..02e9aacb 100644 --- a/hal/msm8916/platform.c +++ b/hal/msm8916/platform.c @@ -2230,7 +2230,8 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o goto exit; } - if (voice_is_in_call(adev) || voice_extn_compress_voip_is_active(adev)) { + if ((mode == AUDIO_MODE_IN_CALL) || + voice_extn_compress_voip_is_active(adev)) { if (devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || devices & AUDIO_DEVICE_OUT_WIRED_HEADSET) { if ((adev->voice.tty_mode != TTY_MODE_OFF) && @@ -2382,8 +2383,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d ALOGV("%s: enter: out_device(%#x) in_device(%#x)", __func__, out_device, in_device); if (my_data->external_mic) { - if ((out_device != AUDIO_DEVICE_NONE && voice_is_in_call(adev)) || - voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev)) { + if ((out_device != AUDIO_DEVICE_NONE) && ((mode == AUDIO_MODE_IN_CALL) || + voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev))) { if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || out_device & AUDIO_DEVICE_OUT_EARPIECE || out_device & AUDIO_DEVICE_OUT_SPEAKER ) @@ -2397,7 +2398,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d if (snd_device != AUDIO_DEVICE_NONE) goto exit; - if ((out_device != AUDIO_DEVICE_NONE) && ((voice_is_in_call(adev)) || + if ((out_device != AUDIO_DEVICE_NONE) && ((mode == AUDIO_MODE_IN_CALL) || voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev))) { if ((adev->voice.tty_mode != TTY_MODE_OFF) && !voice_extn_compress_voip_is_active(adev)) { diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c index 2065b54c..7b867398 100644 --- a/hal/msm8960/platform.c +++ b/hal/msm8960/platform.c @@ -676,7 +676,7 @@ snd_device_t platform_get_output_snd_device(void *platform, audio_devices_t devi goto exit; } - if (voice_is_in_call(adev)) { + if (mode == AUDIO_MODE_IN_CALL) { if (devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || devices & AUDIO_DEVICE_OUT_WIRED_HEADSET) { if (adev->voice.tty_mode == TTY_MODE_FULL) @@ -768,7 +768,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d ALOGV("%s: enter: out_device(%#x) in_device(%#x)", __func__, out_device, in_device); - if ((out_device != AUDIO_DEVICE_NONE) && voice_is_in_call(adev)) { + if ((out_device != AUDIO_DEVICE_NONE) && (mode == AUDIO_MODE_IN_CALL)) { if (adev->voice.tty_mode != TTY_MODE_OFF) { if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) { diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index 26c676a2..45a5621e 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -2059,7 +2059,7 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o goto exit; } - if (voice_is_in_call(adev) || + if ((mode == AUDIO_MODE_IN_CALL) || voice_extn_compress_voip_is_active(adev)) { if (devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || devices & AUDIO_DEVICE_OUT_WIRED_HEADSET) { @@ -2182,8 +2182,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d ALOGV("%s: enter: out_device(%#x) in_device(%#x)", __func__, out_device, in_device); if (my_data->external_mic) { - if ((out_device != AUDIO_DEVICE_NONE && voice_is_in_call(adev)) || - voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev)) { + if ((out_device != AUDIO_DEVICE_NONE) && ((mode == AUDIO_MODE_IN_CALL) || + voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev))) { if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE || out_device & AUDIO_DEVICE_OUT_EARPIECE || out_device & AUDIO_DEVICE_OUT_SPEAKER ) @@ -2197,7 +2197,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d if (snd_device != AUDIO_DEVICE_NONE) goto exit; - if ((out_device != AUDIO_DEVICE_NONE) && ((voice_is_in_call(adev)) || + if ((out_device != AUDIO_DEVICE_NONE) && ((mode == AUDIO_MODE_IN_CALL) || voice_extn_compress_voip_is_active(adev) || audio_extn_hfp_is_active(adev))) { if ((adev->voice.tty_mode != TTY_MODE_OFF) && !voice_extn_compress_voip_is_active(adev)) {