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

Commit 7d48d59a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Always create connection when hci status SUCCESS"

parents a275da1e 9fb0f222
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -3634,9 +3634,12 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
    return;
  }

  /* If initiated dedicated bonding, return the link key now, and initiate
   * disconnect */
  /* If dedicated bonding, and we now have a link key, we are all done */
  /*
   * The device is still in the pairing state machine and we now have the
   * link key.  If we have not sent the link key, send it now and remove
   * the authenticate requirement bit.  Reset the pairing state machine
   * and inform l2cap if the directed bonding was initiated.
   */
  if (is_pairing_device && (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN)) {
    if (p_dev_rec->link_key_not_sent) {
      p_dev_rec->link_key_not_sent = false;
@@ -3646,20 +3649,20 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
    p_dev_rec->security_required &= ~BTM_SEC_OUT_AUTHENTICATE;

    /* remember flag before it is initialized */
    bool is_pair_flags_we_started_dd = false;
    if (btm_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD)
      is_pair_flags_we_started_dd = true;
    else
      is_pair_flags_we_started_dd = false;

    const bool is_pair_flags_we_started_dd =
        btm_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD;
    btm_sec_change_pairing_state(BTM_PAIR_STATE_IDLE);

    if (is_pair_flags_we_started_dd) {
      /* Let l2cap start bond timer */
      l2cu_update_lcb_4_bonding(p_dev_rec->bd_addr, true);
    }

    return;
    LOG_INFO("Connection complete during pairing process peer:%s",
             PRIVATE_ADDRESS(bda));
    BTM_LogHistory(kBtmLogTag, bda, "Dedicated bonding",
                   base::StringPrintf("Initiated:%c pairing_flag:0x%02x",
                                      (is_pair_flags_we_started_dd) ? 'T' : 'F',
                                      p_dev_rec->sec_flags));
  }

  p_dev_rec->hci_handle = handle;