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

Commit 02c8ff5a authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

Simplify btm_remove_acl am: ba219ad2 am: aa34782d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1480892

Change-Id: If107303200f30e3d5b5dff56a2cc4ce2bdaefbfc
parents 326d6b1d aa34782d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -2098,15 +2098,12 @@ tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
  tACL_CONN* p_acl = internal_.btm_bda_to_acl(bd_addr, transport);
  if (p_acl == nullptr) return BTM_UNKNOWN_ADDR;

  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);

  /* Role Switch is pending, postpone until completed */
  if (p_dev_rec && (p_acl->rs_disc_pending == BTM_SEC_RS_PENDING)) {
  if (p_acl->rs_disc_pending == BTM_SEC_RS_PENDING) {
    p_acl->rs_disc_pending = BTM_SEC_DISC_PENDING;
  } else /* otherwise can disconnect right away */
  {
    if (hci_handle != HCI_INVALID_HANDLE && p_dev_rec &&
        p_dev_rec->sec_state != BTM_SEC_STATE_DISCONNECTING) {
    if (hci_handle != HCI_INVALID_HANDLE) {
      btsnd_hcic_disconnect(hci_handle, HCI_ERR_PEER_USER);
    } else {
      status = BTM_UNKNOWN_ADDR;