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-12 22:54:09 -0800
commit5eb2ba4aea5615eaab7ab1a861d516fc845b8c93 (patch)
tree622aebe974f4d0ccb882f089a182e8e60ba6664f
parent200a941531ef18877b72746f1d406de5087cc0f7 (diff)
downloadandroid_system_bt-5eb2ba4aea5615eaab7ab1a861d516fc845b8c93.tar.gz
android_system_bt-5eb2ba4aea5615eaab7ab1a861d516fc845b8c93.tar.bz2
android_system_bt-5eb2ba4aea5615eaab7ab1a861d516fc845b8c93.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;