diff options
author | Satomi <michitsuta@casio.co.jp> | 2016-08-09 09:30:11 -0700 |
---|---|---|
committer | Jakub Pawlowski <jpawlowski@google.com> | 2016-08-09 09:30:58 -0700 |
commit | 3b9c4610e02e45bb534f31cce127656520267f62 (patch) | |
tree | 83f69954903d7a8b5ab83943677af9a8e05ef101 | |
parent | 17be4ae79a4d2890398a31bc15eedbe083b4142c (diff) | |
download | bt-3b9c4610e02e45bb534f31cce127656520267f62.tar.gz |
Rvert "Register for Service Changed notifications for untrusted devices"
This reverts commit 5f0e23d532f4f90d081ccc0e294f404eb5e5b688.
Instead of reusing service discovery data, gatt profile initiates
discovery by service uuid before regular service discovery is started,
and both discovery procedures interfere with each other.
As a result, link is dropped.
Bug: 30462943
Bug: 30481143
Change-Id: Ic63339f4f46eda70e575a4103974766d54a9d624
Signed-off-by: Satomi <michitsuta@casio.co.jp>
-rw-r--r-- | bta/dm/bta_dm_act.c | 1 | ||||
-rw-r--r-- | stack/gatt/gatt_attr.c | 28 |
2 files changed, 15 insertions, 14 deletions
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c index 2fa9d01a2..5c76faae3 100644 --- a/bta/dm/bta_dm_act.c +++ b/bta/dm/bta_dm_act.c @@ -4414,7 +4414,6 @@ static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_D else { sec_event.auth_cmpl.success = TRUE; - /* We also register for Service Changed right after connect. */ if (!p_data->complt.smp_over_br) GATT_ConfigServiceChangeCCC(bda, TRUE, BT_TRANSPORT_LE); } diff --git a/stack/gatt/gatt_attr.c b/stack/gatt/gatt_attr.c index 9a2c6fa80..596ea9bab 100644 --- a/stack/gatt/gatt_attr.c +++ b/stack/gatt/gatt_attr.c @@ -235,24 +235,26 @@ static void gatt_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id, { UNUSED(gatt_if); - GATT_TRACE_EVENT("%s: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", __func__, - (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3], - (bda[4]<<8)+bda[5], connected, conn_id, reason); + GATT_TRACE_EVENT ("%s: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", __FUNCTION__, + (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3], + (bda[4]<<8)+bda[5], connected, conn_id, reason); tGATT_PROFILE_CLCB *p_clcb = gatt_profile_find_clcb_by_bd_addr(bda, transport); - if (connected) { - if (p_clcb == NULL) - p_clcb = gatt_profile_clcb_alloc(conn_id, bda, transport); - - if (p_clcb == NULL) - return; + if (p_clcb == NULL) + return; + if (connected) + { + p_clcb->conn_id = conn_id; p_clcb->connected = TRUE; - p_clcb->ccc_stage = GATT_SVC_CHANGED_SERVICE; - gatt_cl_start_config_ccc(p_clcb); + + if (p_clcb->ccc_stage == GATT_SVC_CHANGED_CONNECTING) + { + p_clcb->ccc_stage ++; + gatt_cl_start_config_ccc(p_clcb); + } } else { - if (p_clcb != NULL) - gatt_profile_clcb_dealloc(p_clcb); + gatt_profile_clcb_dealloc(p_clcb); } } |