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

Commit 0534c27c authored by Chris Manton's avatar Chris Manton
Browse files

Streamline BTM_GetNumAclLinks and acl_get_supported_packet_types

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run

Change-Id: Ifb5f6853c823e35c13b997c3e44d480cc53bc89d
parent a62a0109
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -1199,18 +1199,6 @@ tBTM_STATUS BTM_ReadAutomaticFlushTimeout(const RawAddress& remote_bda,
tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda,
                            tBT_TRANSPORT transport, tBTM_CMPL_CB* p_cb);

/*******************************************************************************
 *
 * Function         BTM_GetNumAclLinks
 *
 * Description      This function is called to count the number of
 *                  ACL links that are active.
 *
 * Returns          uint16_t Number of active ACL links
 *
 ******************************************************************************/
uint16_t BTM_GetNumAclLinks(void);

/*****************************************************************************
 *  (e)SCO CHANNEL MANAGEMENT FUNCTIONS
 ****************************************************************************/
+2 −8
Original line number Diff line number Diff line
@@ -1191,13 +1191,7 @@ uint16_t BTM_GetNumAclLinks(void) {
  if (bluetooth::shim::is_gd_l2cap_enabled()) {
    return bluetooth::shim::L2CA_GetNumLinks();
  }
  uint16_t num_acl = 0;

  for (uint16_t i = 0; i < MAX_L2CAP_LINKS; ++i) {
    if (btm_cb.acl_cb_.acl_db[i].in_use) ++num_acl;
  }

  return num_acl;
  return static_cast<uint16_t>(btm_cb.acl_cb_.NumberOfActiveLinks());
}

/*******************************************************************************
@@ -2524,7 +2518,7 @@ bool acl_is_role_switch_allowed() {
}

uint16_t acl_get_supported_packet_types() {
  return btm_cb.acl_cb_.btm_acl_pkt_types_supported;
  return btm_cb.acl_cb_.DefaultPacketTypes();
}

bool acl_set_peer_le_features_from_handle(uint16_t hci_handle,