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

Commit ec330b88 authored by Chris Manton's avatar Chris Manton
Browse files

mock: Update mock_main_shim_acl

Bug: 324418737
Test: m .
Flag: EXEMPT, Testing infrastructure

Change-Id: I29954559bacfc622c97b71dcedef937ef62cb612
parent f72a8b20
Loading
Loading
Loading
Loading
+232 −6
Original line number Diff line number Diff line
@@ -14,12 +14,238 @@
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:7
 */
#include <base/location.h>
#include <base/strings/stringprintf.h>

#include <cstdint>
#include <future>
#include <memory>
#include <optional>
#include <string>

#include "main/shim/acl_api.h"
#include "common/sync_map_count.h"
#include "device/include/controller.h"
#include "hci/acl_manager.h"
#include "hci/acl_manager/classic_acl_connection.h"
#include "hci/acl_manager/le_acl_connection.h"
#include "hci/address.h"
#include "hci/address_with_type.h"
#include "hci/class_of_device.h"
#include "main/shim/acl.h"
#include "main/shim/entry.h"
#include "os/handler.h"
#include "stack/acl/acl.h"
#include "test/common/mock_functions.h"
#include "types/raw_address.h"

using namespace bluetooth;

void DumpsysL2cap(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysAcl(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysBtm(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysRecord(int /* fd */) { inc_func_call_count(__func__); }

void DumpsysNeighbor(int /* fd */) { inc_func_call_count(__func__); }

void shim::legacy::Acl::Dump(int /* fd */) const {
  inc_func_call_count(__func__);
}

shim::legacy::Acl::Acl(os::Handler* /* handler */,
                       const acl_interface_t& acl_interface,
                       uint8_t /* max_acceptlist_size */,
                       uint8_t /* max_address_resolution_size */)
    : acl_interface_(acl_interface) {
  inc_func_call_count(__func__);
}
shim::legacy::Acl::~Acl() { inc_func_call_count(__func__); }

bool shim::legacy::Acl::CheckForOrphanedAclConnections() const {
  inc_func_call_count(__func__);
  return false;
}

void shim::legacy::Acl::on_incoming_acl_credits(uint16_t /* handle */,
                                                uint16_t /* credits */) {
  inc_func_call_count(__func__);
}

using HciHandle = uint16_t;

struct shim::legacy::Acl::impl {};

void shim::legacy::Acl::CreateClassicConnection(
    const hci::Address& /* address */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::CancelClassicConnection(
    const hci::Address& /* address */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::AcceptLeConnectionFrom(
    const hci::AddressWithType& /* address_with_type */, bool /* is_direct */,
    std::promise<bool> /* promise */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::IgnoreLeConnectionFrom(
    const hci::AddressWithType& /* address_with_type */) {
  inc_func_call_count(__func__);
}

void bluetooth::shim::legacy::Acl::OnClassicLinkDisconnected(
    HciHandle /* handle */, hci::ErrorCode /* reason */) {
  inc_func_call_count(__func__);
}

bluetooth::hci::AddressWithType shim::legacy::Acl::GetConnectionLocalAddress(
    uint16_t /* handle */, bool /* ota_address */) {
  inc_func_call_count(__func__);
  return hci::AddressWithType();
}
bluetooth::hci::AddressWithType shim::legacy::Acl::GetConnectionPeerAddress(
    uint16_t /* handle */, bool /* ota_address */) {
  inc_func_call_count(__func__);
  return hci::AddressWithType();
}

std::optional<uint8_t> shim::legacy::Acl::GetAdvertisingSetConnectedTo(
    const RawAddress& /* remote_bda */) {
  inc_func_call_count(__func__);
  return std::nullopt;
  ;
}

void shim::legacy::Acl::OnLeLinkDisconnected(HciHandle /* handle */,
                                             hci::ErrorCode /* reason */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::OnConnectSuccess(
    std::unique_ptr<hci::acl_manager::ClassicAclConnection> /* connection */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::OnConnectRequest(hci::Address /* address */,
                                         hci::ClassOfDevice /* cod */) {
  inc_func_call_count(__func__);
}
void shim::legacy::Acl::OnConnectFail(hci::Address /* address */,
                                      hci::ErrorCode /* reason */,
                                      bool /* locally_initiated */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::OnLeConnectSuccess(
    hci::AddressWithType /* address_with_type */,
    std::unique_ptr<hci::acl_manager::LeAclConnection> /* connection */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::OnLeConnectFail(
    hci::AddressWithType /* address_with_type */, hci::ErrorCode /* reason */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::DisconnectClassic(uint16_t /* handle */,
                                          tHCI_STATUS /* reason */,
                                          std::string /* comment */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::DisconnectLe(uint16_t /* handle */,
                                     tHCI_STATUS /* reason */,
                                     std::string /* comment */) {
  inc_func_call_count(__func__);
}

bool shim::legacy::Acl::HoldMode(uint16_t /* hci_handle */,
                                 uint16_t /* max_interval */,
                                 uint16_t /* min_interval */) {
  inc_func_call_count(__func__);
  return false;
}

bool shim::legacy::Acl::SniffMode(uint16_t /* hci_handle */,
                                  uint16_t /* max_interval */,
                                  uint16_t /* min_interval */,
                                  uint16_t /* attempt */,
                                  uint16_t /* timeout */) {
  inc_func_call_count(__func__);
  return false;
}

bool shim::legacy::Acl::ExitSniffMode(uint16_t /* hci_handle */) {
  inc_func_call_count(__func__);
  return false;
}

bool shim::legacy::Acl::SniffSubrating(uint16_t /* hci_handle */,
                                       uint16_t /* maximum_latency */,
                                       uint16_t /* minimum_remote_timeout */,
                                       uint16_t /* minimum_local_timeout */) {
  inc_func_call_count(__func__);
  return false;
}

void shim::legacy::Acl::LeSetDefaultSubrate(uint16_t /* subrate_min */,
                                            uint16_t /* subrate_max */,
                                            uint16_t /* max_latency */,
                                            uint16_t /* cont_num */,
                                            uint16_t /* sup_tout */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::LeSubrateRequest(uint16_t /* hci_handle */,
                                         uint16_t /* subrate_min */,
                                         uint16_t /* subrate_max */,
                                         uint16_t /* max_latency */,
                                         uint16_t /* cont_num */,
                                         uint16_t /* sup_tout */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::DumpConnectionHistory(int /* fd */) const {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::DisconnectAllForSuspend() {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::Shutdown() { inc_func_call_count(__func__); }

void shim::legacy::Acl::FinalShutdown() { inc_func_call_count(__func__); }

void shim::legacy::Acl::ClearFilterAcceptList() {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::LeRand(LeRandCallback /* cb */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::AddToAddressResolution(
    const hci::AddressWithType& /* address_with_type */,
    const std::array<uint8_t, 16>& /* peer_irk */,
    const std::array<uint8_t, 16>& /* local_irk */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::RemoveFromAddressResolution(
    const hci::AddressWithType& /* address_with_type */) {
  inc_func_call_count(__func__);
}

void shim::legacy::Acl::ClearAddressResolution() {
  inc_func_call_count(__func__);
}

void bluetooth::shim::ACL_Shutdown() { inc_func_call_count(__func__); }
void shim::legacy::Acl::SetSystemSuspendState(bool /* suspended */) {
  inc_func_call_count(__func__);
}
+2 −0
Original line number Diff line number Diff line
@@ -105,3 +105,5 @@ void bluetooth::shim::ACL_LeSubrateRequest(uint16_t /* hci_handle */,
                                           uint16_t /* sup_tout */) {
  inc_func_call_count(__func__);
}

void bluetooth::shim::ACL_Shutdown() { inc_func_call_count(__func__); }
+73 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "main/shim/acl_legacy_interface.h"

namespace bluetooth {
namespace shim {
namespace legacy {

acl_interface_t acl_interface_ = {
    .on_send_data_upwards = nullptr,
    .on_packets_completed = nullptr,

    .connection.classic.on_connected = nullptr,
    .connection.classic.on_connect_request = nullptr,
    .connection.classic.on_failed = nullptr,
    .connection.classic.on_disconnected = nullptr,

    .connection.le.on_connected = nullptr,
    .connection.le.on_failed = nullptr,
    .connection.le.on_disconnected = nullptr,

    .link.classic.on_authentication_complete = nullptr,
    .link.classic.on_central_link_key_complete = nullptr,
    .link.classic.on_change_connection_link_key_complete = nullptr,
    .link.classic.on_encryption_change = nullptr,
    .link.classic.on_flow_specification_complete = nullptr,
    .link.classic.on_flush_occurred = nullptr,
    .link.classic.on_mode_change = nullptr,
    .link.classic.on_packet_type_changed = nullptr,
    .link.classic.on_qos_setup_complete = nullptr,
    .link.classic.on_read_afh_channel_map_complete = nullptr,
    .link.classic.on_read_automatic_flush_timeout_complete = nullptr,
    .link.classic.on_sniff_subrating = nullptr,
    .link.classic.on_read_clock_complete = nullptr,
    .link.classic.on_read_clock_offset_complete = nullptr,
    .link.classic.on_read_failed_contact_counter_complete = nullptr,
    .link.classic.on_read_link_policy_settings_complete = nullptr,
    .link.classic.on_read_link_quality_complete = nullptr,
    .link.classic.on_read_link_supervision_timeout_complete = nullptr,
    .link.classic.on_read_remote_version_information_complete = nullptr,
    .link.classic.on_read_remote_supported_features_complete = nullptr,
    .link.classic.on_read_remote_extended_features_complete = nullptr,
    .link.classic.on_read_rssi_complete = nullptr,
    .link.classic.on_read_transmit_power_level_complete = nullptr,
    .link.classic.on_role_change = nullptr,
    .link.classic.on_role_discovery_complete = nullptr,

    .link.le.on_connection_update = nullptr,
    .link.le.on_data_length_change = nullptr,
    .link.le.on_read_remote_version_information_complete = nullptr,
    .link.le.on_phy_update = nullptr,
    .link.le.on_le_subrate_change = nullptr,
};

const acl_interface_t& GetAclInterface() { return acl_interface_; }

}  // namespace legacy
}  // namespace shim
}  // namespace bluetooth