hal: Fix device selection at start of the voice call

Voice call setup latency value is exceeding 500 msec. It is due to
primary output selecting handset instead of voice handset causing
the extra delay. Fix this by selecting voice handset when the mode
is set to MODE_IN_CALL.

CRs-Fixed: 855783
Change-Id: Ibfaee75d658bffbcf2e9cdeaa589e0487c214b41
This commit is contained in:
Venkata Narendra Kumar Gutta 2015-06-22 14:25:35 +05:30 committed by Gerrit - the friendly Code Review server
parent 2678746299
commit bfdfa150d3
3 changed files with 11 additions and 10 deletions

View File

@ -2048,7 +2048,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) &&
@ -2197,8 +2198,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 )
@ -2212,7 +2213,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)) {

View File

@ -667,7 +667,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)
@ -759,7 +759,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) {

View File

@ -2058,7 +2058,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) {
@ -2181,8 +2181,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 )
@ -2196,7 +2196,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)) {