From 7bb7c9678ab573751595bc36e0573e71d7b61907 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 26 Nov 2015 21:58:30 +0100 Subject: [PATCH] hfp: start ringing on new SLC if incoming call in progress --- src/hfp_ag.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hfp_ag.c b/src/hfp_ag.c index eaef44341..74a4cfe19 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -93,6 +93,7 @@ static int subscriber_numbers_count = 0; static void packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); static void hfp_run_for_context(hfp_connection_t *context); static void hfp_ag_setup_audio_connection(hfp_connection_t * connection); +static void hfp_ag_hf_start_ringing(hfp_connection_t * context); hfp_generic_status_indicator_t * get_hfp_generic_status_indicators(); int get_hfp_generic_status_indicators_nr(); @@ -535,6 +536,11 @@ static void hfp_ag_slc_established(hfp_connection_t * context){ if (hfp_ag_call_state == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){ context->call_state = HFP_CALL_W4_AUDIO_CONNECTION_FOR_ACTIVE; } + // if AG is ringing, also start ringing on the HF + if (hfp_ag_call_state == HFP_CALL_STATUS_NO_HELD_OR_ACTIVE_CALLS && + hfp_ag_callsetup_state == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){ + hfp_ag_hf_start_ringing(context); + } } static int hfp_ag_run_for_context_service_level_connection(hfp_connection_t * context){ @@ -593,10 +599,11 @@ static int hfp_ag_run_for_context_service_level_connection(hfp_connection_t * co if (context->state != HFP_W4_RETRIEVE_CAN_HOLD_CALL) break; if (has_hf_indicators_feature(context)){ context->state = HFP_W4_LIST_GENERIC_STATUS_INDICATORS; - } else { - hfp_ag_slc_established(context); } hfp_ag_retrieve_can_hold_call_cmd(context->rfcomm_cid); + if (!has_hf_indicators_feature(context)){ + hfp_ag_slc_established(context); + } return 1; case HFP_CMD_LIST_GENERIC_STATUS_INDICATORS: