From 065fb3b080ecd202ab83b421061b0b2a63dd1ecb Mon Sep 17 00:00:00 2001 From: Petteri Tikander Date: Tue, 18 Jun 2013 13:37:21 +0300 Subject: [PATCH] Allow to change audio-route path to BT-headset also after receiving the acknowledgement for bt_ag_open_sco. Fix is for TDIS-6026, TZSP-6058 When switching from receiver- or speaker-audio path to BT-headset in PR3, changing audio-route path to BT-headset fails in voicecall_snd_change_path(), because VCONF-value 'memory/bluetooth/btsco' will be set by BT-framework to TRUE just AFTER checking it, so too late. In Lunchbox, 'memory/bluetooth/btsco' will be set earlier, so voicecall_snd_change_path_real() will be called in voicecall_snd_change_path(). Later even after succesfull receive of __vc_bt_ag_sco_state_changed_cb()-event, 'bt_connected'-flag is still FALSE (because being earlier in receiver/speaker), so audio-path will not be changed even in this function. 'bt_connected'-flag will be set after __vc_bt_audio_connection_state_changed_cb() event, but also now audio-path change fails in __vc_bt_handle_connectivity_event(), because it will be done only, if 'bt_connected' is FALSE. So change of the audio-route never succeeds in PR3 after being earlier in receiver/speaker! --- call-engine/voice-call-bt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/call-engine/voice-call-bt.c b/call-engine/voice-call-bt.c index 82c9b35..4401d60 100755 --- a/call-engine/voice-call-bt.c +++ b/call-engine/voice-call-bt.c @@ -286,8 +286,8 @@ gboolean _vc_bt_handle_bt_events(call_vc_core_state_t *pcall_core, vc_bt_ag_para CALL_ENG_DEBUG(ENG_DEBUG, "Event: %s(%d)", gszbt_req_event[pbt_info->param1], pbt_info->param1); - /*HS Connection not required for sending response to VC_BT_AG_REQ_CALL_STATUS */ - if ((FALSE == pcall_core->bt_connected) && (VC_BT_AG_REQ_CALL_STATUS != pbt_info->param1)) { + /*HS Connection not required for sending response to VC_BT_AG_REQ_CALL_STATUS or VC_BT_AG_REQ_SWITCH_TO_HEADSET */ + if ((FALSE == pcall_core->bt_connected) && (VC_BT_AG_REQ_CALL_STATUS != pbt_info->param1) && (VC_BT_AG_REQ_SWITCH_TO_HEADSET != pbt_info->param1)) { CALL_ENG_DEBUG(ENG_ERR, "BT not connected, Ignoring BT Events, BT Event= %d", pbt_info->param1); return TRUE; } -- 2.34.1