Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 518be643 authored by Chris Manton's avatar Chris Manton
Browse files

Re-log ble acl disconnect path

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink

Change-Id: I34680dc2a3ad25db4e1db804e4ea3eaf22ebc1e8
parent ebe3f015
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -3704,6 +3704,13 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
  tBTM_SEC_CALLBACK* p_callback = NULL;
  tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;

  if ((reason != HCI_ERR_CONN_CAUSE_LOCAL_HOST) &&
      (reason != HCI_ERR_PEER_USER)) {
    /* Uncommon disconnection reasons */
    LOG_WARN("Got Disconn Complete Event: reason=%s, handle=%d",
             hci_error_code_text(reason).c_str(), handle);
  }

  btm_acl_resubmit_page();

  if (!p_dev_rec) return;
@@ -3713,8 +3720,8 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {

  p_dev_rec->rs_disc_pending = BTM_SEC_RS_NOT_PENDING; /* reset flag */

  LOG_INFO("%s clearing pending flag handle:%d reason:%d", __func__, handle,
           reason);
  LOG_INFO("clearing pending flag handle:%d reason:%s", handle,
           hci_error_code_text(reason).c_str());
  p_dev_rec->rs_disc_pending = BTM_SEC_RS_NOT_PENDING; /* reset flag */

  /* clear unused flags */
@@ -3726,9 +3733,6 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
          << " reason: " << reason << " sec_req: " << std::hex
          << p_dev_rec->security_required;

  BTM_TRACE_EVENT("%s before update sec_flags=0x%x", __func__,
                  p_dev_rec->sec_flags);

  /* If we are in the process of bonding we need to tell client that auth failed
   */
  if ((btm_cb.pairing_state != BTM_PAIR_STATE_IDLE) &&
@@ -3795,9 +3799,6 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
    bta_dm_remove_device(p_dev_rec->bd_addr);
  }

  BTM_TRACE_EVENT("%s after update sec_flags=0x%x", __func__,
                  p_dev_rec->sec_flags);

  if (p_dev_rec->sec_state == BTM_SEC_STATE_DISCONNECTING_BOTH) {
    p_dev_rec->sec_state = (transport == BT_TRANSPORT_LE)
                               ? BTM_SEC_STATE_DISCONNECTING
+0 −7
Original line number Diff line number Diff line
@@ -1015,13 +1015,6 @@ static void btu_hcif_disconnection_comp_evt(uint8_t* p) {

  handle = HCID_GET_HANDLE(handle);

  if ((reason != HCI_ERR_CONN_CAUSE_LOCAL_HOST) &&
      (reason != HCI_ERR_PEER_USER)) {
    /* Uncommon disconnection reasons */
    HCI_TRACE_DEBUG("%s: Got Disconn Complete Event: reason=%d, handle=%d",
                    __func__, reason, handle);
  }

  /* If L2CAP or SCO doesn't know about it, send it to ISO */
  if (!l2c_link_hci_disc_comp(handle, reason) &&
      !btm_sco_removed(handle, reason)) {