From: Chao Quan Date: Mon, 23 Oct 2017 11:41:13 +0000 (+0800) Subject: Fix GATT discovery service fail over BR/EDR X-Git-Tag: android-x86-9.0-r1~158^2~5^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b00872797a1c2137e8ef21590e8f7035b2ad722e;p=android-x86%2Fsystem-bt.git Fix GATT discovery service fail over BR/EDR According to the current gattc state machine, stack queues discovery services request comes from framework when gattc is in BTA_GATTC_DISCOVER_ST state. This request is re-scheduled after discovery on server finished in bta_gattc_disc_cmpl and return the discovery results to framemwork. But now, stack assumed LE transport in code, which prevents discovery services executing. This error can be detected by ACTS GATTOverBrEdrTest: test_gatt_bredr_connect_trigger_on_services_discovered Fix assumed transport to actual situantion Test: ACTS GATTOverBrEdrTest: test_gatt_bredr_connect_trigger_on_services_discovered Change-Id: I110a0a3c19595fb76c3bb15b092ce18ebf7b11bf --- diff --git a/bta/gatt/bta_gattc_act.cc b/bta/gatt/bta_gattc_act.cc index a841ed280..8a137dc2e 100644 --- a/bta/gatt/bta_gattc_act.cc +++ b/bta/gatt/bta_gattc_act.cc @@ -714,7 +714,8 @@ void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB* p_clcb, else if (p_q_cmd != NULL) { p_clcb->p_q_cmd = NULL; /* execute pending operation of link block still present */ - if (l2cu_find_lcb_by_bd_addr(p_clcb->p_srcb->server_bda, BT_TRANSPORT_LE)) { + if (l2cu_find_lcb_by_bd_addr(p_clcb->p_srcb->server_bda, + p_clcb->transport)) { bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd); } /* if the command executed requeued the cmd, we don't