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

Commit 265b043c authored by Chris Manton's avatar Chris Manton
Browse files

Initial btif/test/btif_stack_test

Bug: 182544206
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
No-Typo-Check: Legacy code mocks

Change-Id: I5cf4b24651b436a96bfbba43ad33db28707352e3
parent c3543c9a
Loading
Loading
Loading
Loading
+72 −0
Original line number Diff line number Diff line
@@ -303,3 +303,75 @@ cc_test {
    ],
    cflags: ["-DBUILDCFG"],
}

// Cycle stack test
// ========================================================
cc_test {
    name: "net_test_btif_stack",
    host_supported: true,
    defaults: ["fluoride_defaults"],
    test_suites: ["device-tests"],
    include_dirs: [
        "frameworks/av/media/libaaudio/include",
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/bta/dm",
        "packages/modules/Bluetooth/system/bta/include",
        "packages/modules/Bluetooth/system/bta/sys",
        "packages/modules/Bluetooth/system/btcore/include",
        "packages/modules/Bluetooth/system/btif/avrcp",
        "packages/modules/Bluetooth/system/btif/co",
        "packages/modules/Bluetooth/system/btif/include",
        "packages/modules/Bluetooth/system/device/include",
        "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include",
        "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/hci/include",
        "packages/modules/Bluetooth/system/include",
        "packages/modules/Bluetooth/system/internal_include",
        "packages/modules/Bluetooth/system/stack/a2dp",
        "packages/modules/Bluetooth/system/stack/avdt",
        "packages/modules/Bluetooth/system/stack/btm",
        "packages/modules/Bluetooth/system/stack/include",
        "packages/modules/Bluetooth/system/stack/l2cap",
        "packages/modules/Bluetooth/system/udrv/include",
        "packages/modules/Bluetooth/system/utils/include",
        "packages/modules/Bluetooth/system/vnd/include",
        "system/libfmq/include",
        "system/libhwbinder/include",
        ],
      srcs: [
          ":LibBluetoothSources",
          ":TestMockAndroidHardware",
          ":TestMockBta",
          ":TestMockBtcore",
          ":TestMockCommon",
          ":TestMockFrameworks",
          ":TestMockHci",
          ":TestMockMainShim",
          ":TestMockStack",
          ":TestMockSystemLibfmq",
          ":TestMockUdrv",
          "test/btif_stack_test.cc",
      ],
      header_libs: ["libbluetooth_headers"],
      shared_libs: [
          "android.hardware.bluetooth.a2dp@1.0",
          "android.hardware.bluetooth.audio@2.0",
          "android.hardware.bluetooth.audio@2.1",
          "libcrypto",
          "libcutils",
          "libhidlbase",
          "liblog",
          "libtinyxml2",
      ],
      whole_static_libs: [
          "libbtif",
      ],
      static_libs: [
          "libbluetooth-types",
          "libbtdevice",
          "libgmock",
          "libosi",
      ],
      cflags: ["-DBUILDCFG"],
}
+203 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 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 "btif/include/btif_profile_queue.h"

#include <gtest/gtest.h>

#include <base/bind.h>
#include <base/callback.h>
#include <base/location.h>
#include "stack_manager.h"
#include "types/raw_address.h"

#include "bta/include/bta_ag_api.h"  // tBTA_AG_RES_DATA::kEmpty
#include "hci/include/hci_layer.h"   // hci_t

std::map<std::string, int> mock_function_count_map;

void set_hal_cbacks(bt_callbacks_t* callbacks);  // btif/src/bluetooth.cc

// tLEGACY_TRACE_LEVEL
uint8_t btu_trace_level = 6;
uint8_t appl_trace_level = 6;
uint8_t btif_trace_level = 6;

namespace {

void dump_mock_function_count_map() {
  LOG_INFO("Mock function count map size:%zu", mock_function_count_map.size());

  for (auto it : mock_function_count_map) {
    LOG_INFO("function:%s: call_count:%d", it.first.c_str(), it.second);
  }
}

namespace _adapter_state_changed {
bt_state_t state{BT_STATE_OFF};
}
void adapter_state_changed(bt_state_t state) {
  LOG_INFO("%u => %u", _adapter_state_changed::state, state);
}

void adapter_properties(bt_status_t status, int num_properties,
                        bt_property_t* properties) {
  LOG_INFO("Callback rx");
}

void remote_device_properties(bt_status_t status, RawAddress* bd_addr,
                              int num_properties, bt_property_t* properties) {
  LOG_INFO("Callback rx");
}

void device_found(int num_properties, bt_property_t* properties) {
  LOG_INFO("Callback rx");
}

void discovery_state_changed(bt_discovery_state_t state) {
  LOG_INFO("Callback rx");
}

/** Bluetooth Legacy PinKey Request callback */
void pin_request(RawAddress* remote_bd_addr, bt_bdname_t* bd_name, uint32_t cod,
                 bool min_16_digit) {
  LOG_INFO("Callback rx");
}

void ssp_request(RawAddress* remote_bd_addr, bt_bdname_t* bd_name, uint32_t cod,
                 bt_ssp_variant_t pairing_variant, uint32_t pass_key) {
  LOG_INFO("Callback rx");
}

/** Bluetooth Bond state changed callback */
/* Invoked in response to create_bond, cancel_bond or remove_bond */
void bond_state_changed(bt_status_t status, RawAddress* remote_bd_addr,
                        bt_bond_state_t state) {
  LOG_INFO("Callback rx");
}

/** Bluetooth ACL connection state changed callback */
void acl_state_changed(bt_status_t status, RawAddress* remote_bd_addr,
                       bt_acl_state_t state, bt_hci_error_code_t hci_reason) {
  LOG_INFO("status:%s device:%s state:%s", bt_status_text(status).c_str(),
           remote_bd_addr->ToString().c_str(),
           (state) ? "disconnected" : "connected");
}

/** Bluetooth Link Quality Report callback */
void link_quality_report(uint64_t timestamp, int report_id, int rssi, int snr,
                         int retransmission_count,
                         int packets_not_receive_count,
                         int negative_acknowledgement_count) {
  LOG_INFO("Callback rx");
}

void thread_event(bt_cb_thread_evt evt) { LOG_INFO("Callback rx"); }

void dut_mode_recv(uint16_t opcode, uint8_t* buf, uint8_t len) {
  LOG_INFO("Callback rx");
}

void le_test_mode(bt_status_t status, uint16_t num_packets) {
  LOG_INFO("Callback rx");
}

void energy_info(bt_activity_energy_info* energy_info,
                 bt_uid_traffic_t* uid_data) {
  LOG_INFO("Callback rx");
}

bt_callbacks_t bt_callbacks{
    /** set to sizeof(bt_callbacks_t) */
    .size = sizeof(bt_callbacks_t),
    .adapter_state_changed_cb = adapter_state_changed,
    .adapter_properties_cb = adapter_properties,
    .remote_device_properties_cb = remote_device_properties,
    .device_found_cb = device_found,
    .discovery_state_changed_cb = discovery_state_changed,
    .pin_request_cb = pin_request,
    .ssp_request_cb = ssp_request,
    .bond_state_changed_cb = bond_state_changed,
    .acl_state_changed_cb = acl_state_changed,
    .thread_evt_cb = thread_event,
    .dut_mode_recv_cb = dut_mode_recv,
    .le_test_mode_cb = le_test_mode,
    .energy_info_cb = energy_info,
    .link_quality_report_cb = link_quality_report,
};

void set_data_cb(
    base::Callback<void(const base::Location&, BT_HDR*)> send_data_cb) {
  mock_function_count_map[__func__]++;
}

void transmit_command(BT_HDR* command, command_complete_cb complete_callback,
                      command_status_cb status_cb, void* context) {
  mock_function_count_map[__func__]++;
}

future_t* transmit_command_futured(BT_HDR* command) {
  mock_function_count_map[__func__]++;
  return nullptr;
}

void transmit_downward(uint16_t type, void* data) {
  mock_function_count_map[__func__]++;
}

}  // namespace

hci_t mock_hci = {
    .set_data_cb = set_data_cb,
    .transmit_command = transmit_command,
    .transmit_command_futured = transmit_command_futured,
    .transmit_downward = transmit_downward,
};
const hci_t* hci_layer_get_interface() { return &mock_hci; }

bool is_bluetooth_uid() { return false; }
const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};

namespace bluetooth {
namespace common {

class BluetoothMetricsLogger {};

}  // namespace common
}  // namespace bluetooth

class StackCycleTest : public ::testing::Test {
 protected:
  void SetUp() override { stack_manager_ = stack_manager_get_interface(); }

  void TearDown() override { stack_manager_ = nullptr; }
  const stack_manager_t* stack_manager_{nullptr};
};

TEST_F(StackCycleTest, stack_init) {
  // TODO load init flags
  // bluetooth::common::InitFlags::Load(init_flags);

  set_hal_cbacks(&bt_callbacks);

  stack_manager_get_interface()->init_stack();

  LOG_INFO("Initialized stack");

  ASSERT_EQ(1, mock_function_count_map["set_data_cb"]);

  dump_mock_function_count_map();
}
+70 −0
Original line number Diff line number Diff line
@@ -11,3 +11,73 @@ subdirs = [
    "rootcanal",
    "suite",
]

filegroup {
    name: "TestMockBta",
    srcs: [
      "mock/mock_bta_*.cc",
    ],
}

filegroup {
    name: "TestMockMainShim",
    srcs: [
      "mock/mock_main_shim*.cc",
    ],
}

filegroup {
    name: "TestMockCommon",
    srcs: [
      "mock/mock_common_*.cc",
    ],
}

filegroup {
    name: "TestMockStack",
    srcs: [
      "mock/mock_stack_*.cc",
    ],
}

filegroup {
    name: "TestMockHci",
    srcs: [
      "mock/mock_hci_*.cc",
    ],
}

filegroup {
    name: "TestMockFrameworks",
    srcs: [
      "mock/mock_frameworks_*.cc",
    ],
}

filegroup {
    name: "TestMockBtcore",
    srcs: [
      "mock/mock_btcore_*.cc",
    ],
}

filegroup {
    name: "TestMockSystemLibfmq",
    srcs: [
      "mock/mock_system_libfmq_*.cc",
    ],
}

filegroup {
    name: "TestMockUdrv",
    srcs: [
      "mock/mock_udrv_*.cc",
    ],
}

filegroup {
    name: "TestMockAndroidHardware",
    srcs: [
      "mock/mock_android_hardware_*.cc",
    ],
}
+67 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 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.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:9
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <string.h>
#include "a2dp_api.h"
#include "a2dp_int.h"
#include "avdt_api.h"
#include "bt_common.h"
#include "bt_target.h"
#include "osi/include/log.h"
#include "sdpdefs.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

tA2DP_STATUS A2DP_AddRecord(uint16_t service_uuid, char* p_service_name,
                            char* p_provider_name, uint16_t features,
                            uint32_t sdp_handle) {
  mock_function_count_map[__func__]++;
  return A2DP_SUCCESS;
}
tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr,
                              tA2DP_SDP_DB_PARAMS* p_db,
                              tA2DP_FIND_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
  return A2DP_SUCCESS;
}
uint16_t A2DP_GetAvdtpVersion() {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t A2DP_BitsSet(uint64_t num) {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t A2DP_SetTraceLevel(uint8_t new_level) {
  mock_function_count_map[__func__]++;
  return 0;
}
void A2DP_Init(void) { mock_function_count_map[__func__]++; }
void a2dp_set_avdt_sdp_ver(uint16_t avdt_sdp_ver) {
  mock_function_count_map[__func__]++;
}
+351 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 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.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:67
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <base/logging.h>
#include <inttypes.h>
#include "a2dp_aac.h"
#include "a2dp_codec_api.h"
#include "a2dp_sbc.h"
#include "a2dp_vendor.h"
#include "bta/av/bta_av_int.h"
#include "osi/include/log.h"
#include "osi/include/properties.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

A2dpCodecConfig* A2dpCodecConfig::createCodec(
    btav_a2dp_codec_index_t codec_index,
    btav_a2dp_codec_priority_t codec_priority) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
A2dpCodecConfig* A2dpCodecs::findSinkCodecConfig(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
A2dpCodecConfig* A2dpCodecs::findSourceCodecConfig(
    const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
A2dpCodecConfig::A2dpCodecConfig(btav_a2dp_codec_index_t codec_index,
                                 const std::string& name,
                                 btav_a2dp_codec_priority_t codec_priority)
    : codec_index_(codec_index),
      name_(name),
      default_codec_priority_(codec_priority) {
  mock_function_count_map[__func__]++;
}
A2dpCodecConfig::~A2dpCodecConfig() { mock_function_count_map[__func__]++; }
A2dpCodecs::A2dpCodecs(
    const std::vector<btav_a2dp_codec_config_t>& codec_priorities)
    : current_codec_config_(nullptr) {
  mock_function_count_map[__func__]++;
}
A2dpCodecs::~A2dpCodecs() { mock_function_count_map[__func__]++; }
bool A2DP_AdjustCodec(uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_BuildCodecHeader(const uint8_t* p_codec_info, BT_HDR* p_buf,
                           uint16_t frames_per_packet) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_CodecEquals(const uint8_t* p_codec_info_a,
                      const uint8_t* p_codec_info_b) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_CodecTypeEquals(const uint8_t* p_codec_info_a,
                          const uint8_t* p_codec_info_b) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_GetPacketTimestamp(const uint8_t* p_codec_info, const uint8_t* p_data,
                             uint32_t* p_timestamp) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_InitCodecConfig(btav_a2dp_codec_index_t codec_index,
                          AvdtpSepConfig* p_cfg) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsPeerSinkCodecValid(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsPeerSourceCodecSupported(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsPeerSourceCodecValid(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsSinkCodecSupported(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsSinkCodecValid(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_IsSourceCodecValid(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2DP_UsesRtpHeader(bool content_protection_enabled,
                        const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::codecConfigIsValid(
    const btav_a2dp_codec_config_t& codec_config) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::copyOutOtaCodecConfig(uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::getCodecSpecificConfig(tBT_A2DP_OFFLOAD* p_a2dp_offload) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::isCodecConfigEmpty(
    const btav_a2dp_codec_config_t& codec_config) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::isValid() const {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecConfig::setCodecUserConfig(
    const btav_a2dp_codec_config_t& codec_user_config,
    const btav_a2dp_codec_config_t& codec_audio_config,
    const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
    const uint8_t* p_peer_codec_info, bool is_capability,
    uint8_t* p_result_codec_config, bool* p_restart_input,
    bool* p_restart_output, bool* p_config_updated) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::getCodecConfigAndCapabilities(
    btav_a2dp_codec_config_t* p_codec_config,
    std::vector<btav_a2dp_codec_config_t>* p_codecs_local_capabilities,
    std::vector<btav_a2dp_codec_config_t>* p_codecs_selectable_capabilities) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::init() {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::isSupportedCodec(btav_a2dp_codec_index_t codec_index) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setCodecAudioConfig(
    const btav_a2dp_codec_config_t& codec_audio_config,
    const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
    const uint8_t* p_peer_sink_capabilities, uint8_t* p_result_codec_config,
    bool* p_restart_output, bool* p_config_updated) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setCodecConfig(const uint8_t* p_peer_codec_info,
                                bool is_capability,
                                uint8_t* p_result_codec_config,
                                bool select_current_codec) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setCodecOtaConfig(
    const uint8_t* p_ota_codec_config,
    const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
    uint8_t* p_result_codec_config, bool* p_restart_input,
    bool* p_restart_output, bool* p_config_updated) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setCodecUserConfig(
    const btav_a2dp_codec_config_t& codec_user_config,
    const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
    const uint8_t* p_peer_sink_capabilities, uint8_t* p_result_codec_config,
    bool* p_restart_input, bool* p_restart_output, bool* p_config_updated) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setPeerSinkCodecCapabilities(
    const uint8_t* p_peer_codec_capabilities) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setPeerSourceCodecCapabilities(
    const uint8_t* p_peer_codec_capabilities) {
  mock_function_count_map[__func__]++;
  return false;
}
bool A2dpCodecs::setSinkCodecConfig(const uint8_t* p_peer_codec_info,
                                    bool is_capability,
                                    uint8_t* p_result_codec_config,
                                    bool select_current_codec) {
  mock_function_count_map[__func__]++;
  return false;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecAudioConfig() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecCapability() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecConfig() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecLocalCapability() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecSelectableCapability() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_config_t A2dpCodecConfig::getCodecUserConfig() {
  mock_function_count_map[__func__]++;
  btav_a2dp_codec_config_t config;
  return config;
}
btav_a2dp_codec_index_t A2DP_SinkCodecIndex(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return BTAV_A2DP_CODEC_INDEX_MAX;
}
btav_a2dp_codec_index_t A2DP_SourceCodecIndex(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return BTAV_A2DP_CODEC_INDEX_MAX;
}
const char* A2DP_CodecIndexStr(btav_a2dp_codec_index_t codec_index) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
const char* A2DP_CodecName(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterface(
    const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterface(
    const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return nullptr;
}
int A2DP_GetSinkTrackChannelType(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
int A2DP_GetTrackBitsPerSample(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
int A2DP_GetTrackChannelCount(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
int A2DP_GetTrackSampleRate(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
int A2dpCodecConfig::getTrackBitRate() const {
  mock_function_count_map[__func__]++;
  return 0;
}
std::string A2DP_CodecInfoString(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
std::string A2dpCodecConfig::codecBitsPerSample2Str(
    btav_a2dp_codec_bits_per_sample_t codec_bits_per_sample) {
  mock_function_count_map[__func__]++;
  return 0;
}
std::string A2dpCodecConfig::codecChannelMode2Str(
    btav_a2dp_codec_channel_mode_t codec_channel_mode) {
  mock_function_count_map[__func__]++;
  return 0;
}
std::string A2dpCodecConfig::codecConfig2Str(
    const btav_a2dp_codec_config_t& codec_config) {
  mock_function_count_map[__func__]++;
  return 0;
}
std::string A2dpCodecConfig::codecSampleRate2Str(
    btav_a2dp_codec_sample_rate_t codec_sample_rate) {
  mock_function_count_map[__func__]++;
  return 0;
}
tA2DP_CODEC_TYPE A2DP_GetCodecType(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t A2DP_GetMediaType(const uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t A2dpCodecConfig::getAudioBitsPerSample() {
  mock_function_count_map[__func__]++;
  return 0;
}
void A2DP_InitDefaultCodec(uint8_t* p_codec_info) {
  mock_function_count_map[__func__]++;
}
void A2dpCodecConfig::debug_codec_dump(int fd) {
  mock_function_count_map[__func__]++;
}
void A2dpCodecConfig::setCodecPriority(
    btav_a2dp_codec_priority_t codec_priority) {
  mock_function_count_map[__func__]++;
}
void A2dpCodecConfig::setDefaultCodecPriority() {
  mock_function_count_map[__func__]++;
}
void A2dpCodecs::debug_codec_dump(int fd) {
  mock_function_count_map[__func__]++;
}
Loading