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

Commit 9a5b6b8d authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Remove acl_create_le_connection

It's just another version of acl_create_le_connection_with_id.
Having just one method with mocks for that is enough.

Bug: 372202918
Test: mma -j32
Flag: EXEMPT, trivial
Change-Id: If88160675537dbbe190f423bada13d67f6a36a41
parent a2e3a187
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2494,10 +2494,6 @@ bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr,
  return true;
}

bool acl_create_le_connection(const RawAddress& bd_addr) {
  return acl_create_le_connection_with_id(CONN_MGR_ID_L2CAP, bd_addr);
}

void acl_rcv_acl_data(BT_HDR* p_msg) {
  acl_header_t acl_header{
          .handle = HCI_INVALID_HANDLE,
+5 −4
Original line number Diff line number Diff line
@@ -100,7 +100,8 @@ namespace {
class FakeBtStack {
public:
  FakeBtStack() {
    test::mock::stack_acl::acl_create_le_connection.body = [](const RawAddress& /*bd_addr*/) {
    test::mock::stack_acl::acl_create_le_connection_with_id.body =
            [](uint8_t /* id */, const RawAddress& /* bd_addr */, tBLE_ADDR_TYPE /* addr_type */) {
              return true;
            };
    test::mock::stack_acl::acl_send_data_packet_br_edr.body = [](const RawAddress& /*bd_addr*/,
@@ -131,7 +132,7 @@ public:
  }

  ~FakeBtStack() {
    test::mock::stack_acl::acl_create_le_connection = {};
    test::mock::stack_acl::acl_create_le_connection_with_id = {};
    test::mock::stack_acl::acl_send_data_packet_br_edr = {};
    test::mock::stack_acl::acl_send_data_packet_ble = {};
    bluetooth::hci::testing::mock_controller_ = nullptr;
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@

// This header contains functions for L2cap-ACL to invoke
//
bool acl_create_le_connection(const RawAddress& bd_addr);
bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr,
                                      tBLE_ADDR_TYPE addr_type = BLE_ADDR_PUBLIC);
void acl_send_data_packet_br_edr(const RawAddress& bd_addr, BT_HDR* p_buf);
+1 −1
Original line number Diff line number Diff line
@@ -926,7 +926,7 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
/** This function is to initate a direct connection. Returns true if connection
 * initiated, false otherwise. */
bool l2cble_create_conn(tL2C_LCB* p_lcb) {
  if (!acl_create_le_connection(p_lcb->remote_bd_addr)) {
  if (!acl_create_le_connection_with_id(CONN_MGR_ID_L2CAP, p_lcb->remote_bd_addr)) {
    return false;
  }

+0 −5
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ struct BTM_IsAclConnectionUp BTM_IsAclConnectionUp;
struct BTM_IsBleConnection BTM_IsBleConnection;
struct BTM_ReadRemoteConnectionAddr BTM_ReadRemoteConnectionAddr;
struct BTM_is_sniff_allowed_for BTM_is_sniff_allowed_for;
struct acl_create_le_connection acl_create_le_connection;
struct acl_create_le_connection_with_id acl_create_le_connection_with_id;
struct acl_is_role_switch_allowed acl_is_role_switch_allowed;
struct acl_is_switch_role_idle acl_is_switch_role_idle;
@@ -153,10 +152,6 @@ bool BTM_is_sniff_allowed_for(const RawAddress& peer_addr) {
  inc_func_call_count(__func__);
  return test::mock::stack_acl::BTM_is_sniff_allowed_for(peer_addr);
}
bool acl_create_le_connection(const RawAddress& bd_addr) {
  inc_func_call_count(__func__);
  return test::mock::stack_acl::acl_create_le_connection(bd_addr);
}
bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr,
                                      tBLE_ADDR_TYPE addr_type) {
  inc_func_call_count(__func__);
Loading