Loading system/btif/src/btif_hf.cc +25 −2 Original line number Original line Diff line number Diff line Loading @@ -428,8 +428,31 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) { btif_hf_cb[idx].connected_bda, p_data->open.status); btif_hf_cb[idx].connected_bda, p_data->open.status); RawAddress connected_bda = btif_hf_cb[idx].connected_bda; RawAddress connected_bda = btif_hf_cb[idx].connected_bda; reset_control_block(&btif_hf_cb[idx]); reset_control_block(&btif_hf_cb[idx]); if (com::android::bluetooth::flags:: ignore_notify_when_already_connected()) { bool notify_required = true; for (int i = 0; i < BTA_AG_MAX_NUM_CLIENTS; i++) { if ((i != idx) && (BTHF_CONNECTION_STATE_CONNECTED == btif_hf_cb[i].state) && (connected_bda == btif_hf_cb[i].connected_bda)) { // There is already an active cnnection on this device // skip upper layer notification notify_required = false; break; } } if (notify_required) { bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, &connected_bda); &connected_bda); } } else { bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, &connected_bda); } log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum:: log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum:: HFP_SELF_INITIATED_AG_FAILED, HFP_SELF_INITIATED_AG_FAILED, 1); 1); Loading Loading
system/btif/src/btif_hf.cc +25 −2 Original line number Original line Diff line number Diff line Loading @@ -428,8 +428,31 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) { btif_hf_cb[idx].connected_bda, p_data->open.status); btif_hf_cb[idx].connected_bda, p_data->open.status); RawAddress connected_bda = btif_hf_cb[idx].connected_bda; RawAddress connected_bda = btif_hf_cb[idx].connected_bda; reset_control_block(&btif_hf_cb[idx]); reset_control_block(&btif_hf_cb[idx]); if (com::android::bluetooth::flags:: ignore_notify_when_already_connected()) { bool notify_required = true; for (int i = 0; i < BTA_AG_MAX_NUM_CLIENTS; i++) { if ((i != idx) && (BTHF_CONNECTION_STATE_CONNECTED == btif_hf_cb[i].state) && (connected_bda == btif_hf_cb[i].connected_bda)) { // There is already an active cnnection on this device // skip upper layer notification notify_required = false; break; } } if (notify_required) { bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, &connected_bda); &connected_bda); } } else { bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, &connected_bda); } log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum:: log_counter_metrics_btif(android::bluetooth::CodePathCounterKeyEnum:: HFP_SELF_INITIATED_AG_FAILED, HFP_SELF_INITIATED_AG_FAILED, 1); 1); Loading