From b67cd39b52bfec2746c379928d31cab1252f0769 Mon Sep 17 00:00:00 2001 From: weichinweng Date: Thu, 8 Aug 2019 17:30:07 +0800 Subject: [PATCH] Remove direct connection after notifying the connection up After notifying the connection up, remove direct connection related with this device to make sure no client is directly connecting the device in connection_manager. Bug: 138819537 Test: 1. Repair BLE device 2. Reconnect BLE deivce 3. reboot DUT, make sure Hearing Aid can be connected. Change-Id: I30ff7c47445ec2a3dbd9702ca79873063210e6df --- stack/gatt/gatt_main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stack/gatt/gatt_main.cc b/stack/gatt/gatt_main.cc index b332496f4..61e105b40 100644 --- a/stack/gatt/gatt_main.cc +++ b/stack/gatt/gatt_main.cc @@ -822,6 +822,9 @@ static void gatt_send_conn_cback(tGATT_TCB* p_tcb) { } } + /* Remove the direct connection */ + connection_manager::on_connection_complete(p_tcb->peer_bda); + if (!p_tcb->app_hold_link.empty() && p_tcb->att_lcid == L2CAP_ATT_CID) { /* disable idle timeout if one or more clients are holding the link disable * the idle timer */ -- 2.11.0