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

Commit d4384536 authored by Zach Johnson's avatar Zach Johnson Committed by Automerger Merge Worker
Browse files

Remove return type from l2c_link_hci_conn_req am: 45103187 am: 617859c6

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

Change-Id: I81fa16ee1f039f4da1d36f8c2312d8cb634930c1
parents c23e3465 617859c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@

// This header contains functions for HCI-LinkManagement to invoke

extern bool l2c_link_hci_conn_req(const RawAddress& bd_addr);
extern void l2c_link_hci_conn_req(const RawAddress& bd_addr);

extern void l2c_link_process_num_completed_pkts(uint8_t* p, uint8_t evt_len);

+4 −12
Original line number Diff line number Diff line
@@ -49,10 +49,8 @@ static bool l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf,
 * Description      This function is called when an HCI Connection Request
 *                  event is received.
 *
 * Returns          true, if accept conn
 *
 ******************************************************************************/
bool l2c_link_hci_conn_req(const RawAddress& bd_addr) {
void l2c_link_hci_conn_req(const RawAddress& bd_addr) {
  tL2C_LCB* p_lcb;
  tL2C_LCB* p_lcb_cur;
  int xx;
@@ -67,7 +65,7 @@ bool l2c_link_hci_conn_req(const RawAddress& bd_addr) {
    if (!p_lcb) {
      btsnd_hcic_reject_conn(bd_addr, HCI_ERR_HOST_REJECT_RESOURCES);
      L2CAP_TRACE_ERROR("L2CAP failed to allocate LCB");
      return false;
      return;
    }

    no_links = true;
@@ -99,15 +97,13 @@ bool l2c_link_hci_conn_req(const RawAddress& bd_addr) {
    /* Start a timer waiting for connect complete */
    alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_LINK_CONNECT_TIMEOUT_MS,
                       l2c_lcb_timer_timeout, p_lcb);
    return (true);
    return;
  }

  /* We already had a link control block to the guy. Check what state it is in
  /* We already had a link control block. Check what state it is in
   */
  if ((p_lcb->link_state == LST_CONNECTING) ||
      (p_lcb->link_state == LST_CONNECT_HOLDING)) {
    /* Connection collision. Accept the connection anyways. */

    if (!btm_dev_support_switch(bd_addr))
      p_lcb->link_role = HCI_ROLE_SLAVE;
    else
@@ -116,18 +112,14 @@ bool l2c_link_hci_conn_req(const RawAddress& bd_addr) {
    btsnd_hcic_accept_conn(bd_addr, p_lcb->link_role);

    p_lcb->link_state = LST_CONNECTING;
    return (true);
  } else if (p_lcb->link_state == LST_DISCONNECTING) {
    /* In disconnecting state, reject the connection. */
    btsnd_hcic_reject_conn(bd_addr, HCI_ERR_HOST_REJECT_DEVICE);
  } else {
    L2CAP_TRACE_ERROR(
        "L2CAP got conn_req while connected (state:%d). Reject it",
        p_lcb->link_state);
    /* Reject the connection with ACL Connection Already exist reason */
    btsnd_hcic_reject_conn(bd_addr, HCI_ERR_CONNECTION_EXISTS);
  }
  return (false);
}

void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status,