OSDN Git Service

Re-log stack/acl/btm_acl::acl_disconnect_after_role_switch
authorChris Manton <cmanton@google.com>
Thu, 12 Nov 2020 00:44:45 +0000 (16:44 -0800)
committerChris Manton <cmanton@google.com>
Thu, 12 Nov 2020 17:17:10 +0000 (09:17 -0800)
Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Ifa72697bc33520e21c51ce7d82856497adf6f282

stack/acl/btm_acl.cc

index f7df321..8fcd836 100644 (file)
@@ -2686,13 +2686,14 @@ void acl_disconnect_after_role_switch(uint16_t conn_handle, uint16_t reason) {
   /* If a role switch is in progress, delay the HCI Disconnect to avoid
    * controller problem */
   if (p_acl->rs_disc_pending == BTM_SEC_RS_PENDING) {
-    BTM_TRACE_DEBUG(
-        "RS in progress - Set DISC Pending flag in btm_sec_send_hci_disconnect "
+    LOG_DEBUG(
+        "Role switch in progress - Set DISC Pending flag in "
+        "btm_sec_send_hci_disconnect "
         "to delay disconnect");
     p_acl->rs_disc_pending = BTM_SEC_DISC_PENDING;
-  }
-  /* Tear down the HCI link */
-  else {
+  } else {
+    LOG_DEBUG("Sending acl disconnect reason:%s [%hu]",
+              hci_error_code_text(reason).c_str(), reason);
     btsnd_hcic_disconnect(conn_handle, reason);
   }
 }