summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Arora <niarora@codeaurora.org>2015-10-28 18:39:52 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-11-17 04:16:48 -0800
commit75fb90d3938f4de3691f1cbc056586cdf7d61afc (patch)
tree622aebe974f4d0ccb882f089a182e8e60ba6664f
parent7f1f1722750a2ae24a6d7da834bf0cc2f56e1f03 (diff)
downloadandroid_system_bt-75fb90d3938f4de3691f1cbc056586cdf7d61afc.tar.gz
android_system_bt-75fb90d3938f4de3691f1cbc056586cdf7d61afc.tar.bz2
android_system_bt-75fb90d3938f4de3691f1cbc056586cdf7d61afc.zip
Avoid indications/notifications without clcb allocation
This change is specifically for certain HOGP device which start sending notifications immidiately on repairing, even before the HH profile connection is made. The check here, prevents the processing of notification/indication sent to the DUT before channel control block is allocated for the specific remote device so that the remote HID device is not stuck in connecting state due to HOGP state machine unable to proceed from the profile connection initiation state. CRs-Fixed: 936100 Change-Id: I77a1a39ea7f1d1344cfcf0fefe1fc0e28c213b60
-rwxr-xr-xbta/gatt/bta_gattc_act.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bta/gatt/bta_gattc_act.c b/bta/gatt/bta_gattc_act.c
index f62468d1c..078de1271 100755
--- a/bta/gatt/bta_gattc_act.c
+++ b/bta/gatt/bta_gattc_act.c
@@ -2146,15 +2146,17 @@ static void bta_gattc_cmpl_cback(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_STATUS
APPL_TRACE_DEBUG("bta_gattc_cmpl_cback: conn_id = %d op = %d status = %d",
conn_id, op, status);
+ p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
+ tGATT_IF gatt_if = ((tGATT_IF)((UINT8) (conn_id)));
/* notification and indication processed right away */
- if (op == GATTC_OPTYPE_NOTIFICATION || op == GATTC_OPTYPE_INDICATION)
+ if ((op == GATTC_OPTYPE_NOTIFICATION || op == GATTC_OPTYPE_INDICATION) &&
+ (p_clcb || !bta_hh_le_is_hh_gatt_if(gatt_if)))
{
bta_gattc_process_indicate(conn_id, op, p_data);
return;
}
- /* for all other operation, not expected if w/o connection */
- else if ((p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id)) == NULL)
+ else if (p_clcb == NULL)
{
APPL_TRACE_ERROR("bta_gattc_cmpl_cback unknown conn_id = %d, ignore data", conn_id);
return;