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

Commit 2a4a52ff authored by Myles Watson's avatar Myles Watson
Browse files

BTM_SEC: Change pairing state when ACL is already connected

Returning early from btm_sec_dd_create_conn skipped the state
update, which results in failed pairing in some cases.

Bug: 345552848
Test: atest RfcommTest
Flag: EXEMPT, simple bug fix with a test
Change-Id: I00828ed796411055eef042f7d68c751450e7c38a
parent af302719
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2111,11 +2111,11 @@ void btm_sec_abort_access_req(const RawAddress& bd_addr) {
static tBTM_STATUS btm_sec_dd_create_conn(tBTM_SEC_DEV_REC* p_dev_rec) {
  tBTM_STATUS status = l2cu_ConnectAclForSecurity(p_dev_rec->bd_addr);
  if (status == BTM_CMD_STARTED) {
    btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
    /* If already connected, start pending security procedure */
    if (BTM_IsAclConnectionUp(p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR)) {
      return BTM_SUCCESS;
    }
    btm_sec_cb.change_pairing_state(BTM_PAIR_STATE_WAIT_PIN_REQ);
    return BTM_CMD_STARTED;
  } else if (status == BTM_NO_RESOURCES) {
    return BTM_NO_RESOURCES;