OSDN Git Service

Use p_acl->remote_addr to do BTA_dm_acl_down
authorweichinweng <weichinweng@google.com>
Tue, 10 Nov 2020 07:06:30 +0000 (15:06 +0800)
committerweichinweng <weichinweng@google.com>
Tue, 10 Nov 2020 07:54:04 +0000 (15:54 +0800)
Use p_acl->remote_addr to do BTA_dm_acl_down, not p_acl->conn_addr.

Bug: 171669750
Tag: #feature
Test: compile & forget BLE/Hearingaids device while connected.
Change-Id: Ie44e818c4bc176df5426996a06a99536c5250077

stack/acl/btm_acl.cc

index ea22125..f7df321 100644 (file)
@@ -396,17 +396,12 @@ void btm_acl_removed(uint16_t handle) {
     LOG_WARN("Unable to find active acl");
     return;
   }
-  RawAddress bda = p_acl->remote_addr;
-  tBT_TRANSPORT transport = p_acl->transport;
-  if (transport == BT_TRANSPORT_LE) {
-    bda = p_acl->conn_addr;
-  }
   p_acl->in_use = false;
 
   /* Only notify if link up has had a chance to be issued */
   if (p_acl->link_up_issued) {
     p_acl->link_up_issued = false;
-    BTA_dm_acl_down(bda, transport);
+    BTA_dm_acl_down(p_acl->remote_addr, p_acl->transport);
   }
 
   memset(p_acl, 0, sizeof(tACL_CONN));