summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbalakrishna <quic_kunthumu@quicinc.com>2023-03-13 16:57:51 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2023-03-22 19:07:47 -0700
commit11cc96aff6e1cea761ba5527780267bf2a846f4c (patch)
tree3981cfe71974c5a3284dc7c1fdd7bd150ac9b618
parentb9cfe12742f545ea9f231212c31c0e1f9e2f0f10 (diff)
BT: Fix allows RD(Carkit) will reconnect with DUT (1/2).
Root cause: Some remote devices do not respond to DUT when user trun off and turn ON the BT Fix: Add remote device into L2CAP_DISCONNECT_ACL_DIRECTLY blacklist. Disconnect ACL with remote device during BT off in DUT. CRs-Fixed: 3421296 Change-Id: I068fc1c2b339c79966c1258a11bf265f77803c55
-rw-r--r--device/include/interop.h3
-rw-r--r--stack/l2cap/l2c_csm.cc8
2 files changed, 11 insertions, 0 deletions
diff --git a/device/include/interop.h b/device/include/interop.h
index f3d0d36f7..f8a729f4a 100644
--- a/device/include/interop.h
+++ b/device/include/interop.h
@@ -298,6 +298,9 @@ typedef enum {
// local device to be only master as role switch would be restricted during connection.
INTEROP_DISABLE_ROLE_SWITCH_DURING_CONNECTION,
+ //Add remote device into L2CAP_DISCONNECT_ACL_DIRECTLY blacklist
+ INTEROP_L2CAP_DISCONNECT_ACL_DIRECTLY,
+
END_OF_INTEROP_LIST
} interop_feature_t;
diff --git a/stack/l2cap/l2c_csm.cc b/stack/l2cap/l2c_csm.cc
index 2e70f20e7..2dce61377 100644
--- a/stack/l2cap/l2c_csm.cc
+++ b/stack/l2cap/l2c_csm.cc
@@ -1943,6 +1943,14 @@ static void l2c_csm_open(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
break;
case L2CEVT_L2CA_DISCONNECT_REQ: /* Upper wants to disconnect */
+ if (p_ccb->p_lcb->transport == BT_TRANSPORT_BR_EDR &&
+ p_ccb->p_rcb->psm != BT_PSM_SDP &&
+ interop_match_addr_or_name(INTEROP_L2CAP_DISCONNECT_ACL_DIRECTLY,
+ &p_ccb->p_lcb->remote_bd_addr)) {
+ L2CAP_TRACE_ERROR("disconnect acl directly.");
+ btm_sec_disconnect(p_ccb->p_lcb->handle, HCI_ERR_PEER_USER);
+ }
+
if (p_ccb->p_lcb->transport != BT_TRANSPORT_LE) {
/* Make sure we are not in sniff mode */
{