OSDN Git Service

Re-point bta:: tests to common test/mock
authorChris Manton <cmanton@google.com>
Fri, 30 Apr 2021 22:21:38 +0000 (15:21 -0700)
committerChris Manton <cmanton@google.com>
Mon, 3 May 2021 01:43:04 +0000 (18:43 -0700)
Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I8dbfc4754a754011a0c06c5f8d21abce15931cd3

35 files changed:
bta/Android.bp
bta/test/bta_dm_test.cc
bta/test/common/mock_btif_dm.cc [deleted file]
bta/test/common/mock_device_controller.cc [deleted file]
bta/test/common/mock_shim.cc [deleted file]
bta/test/common/mock_stack_acl.cc [deleted file]
bta/test/common/mock_stack_btm.cc [deleted file]
bta/test/common/mock_stack_btm_ble.cc [deleted file]
bta/test/common/mock_stack_btm_dev.cc [deleted file]
bta/test/common/mock_stack_btm_main.cc [deleted file]
bta/test/common/mock_stack_btm_pm.cc [deleted file]
bta/test/common/mock_stack_btm_sco.cc [deleted file]
bta/test/common/mock_stack_btm_sec.cc [deleted file]
bta/test/common/mock_stack_gatt.cc [deleted file]
bta/test/common/mock_stack_gatt_connection_manager.cc [deleted file]
bta/test/common/mock_stack_hidh.cc [deleted file]
bta/test/common/mock_stack_l2cap.cc [deleted file]
bta/test/common/mock_stack_l2cap_ble.cc [deleted file]
bta/test/common/mock_stack_sdp.cc [deleted file]
test/Android.bp
test/mock/mock_btif_co_bta_dm_co.cc [moved from bta/test/common/mock_btif_co_bta_dm_co.cc with 100% similarity]
test/mock/mock_btif_co_bta_hh_co.cc [moved from bta/test/common/mock_btif_co_bta_hh_co.cc with 100% similarity]
test/mock/mock_btif_debug_conn.cc [moved from bta/test/common/mock_btif_debug_conn.cc with 100% similarity]
test/mock/mock_btif_stack_manager.cc [moved from bta/test/common/mock_btif_stack_manager.cc with 100% similarity]
test/mock/mock_btif_storage.cc [moved from bta/test/common/mock_btif_storage.cc with 100% similarity]
test/mock/mock_device_interop.cc [moved from bta/test/common/mock_device_interop.cc with 100% similarity]
test/mock/mock_main_shim_acl.cc [moved from bta/test/common/mock_main_shim_acl.cc with 100% similarity]
test/mock/mock_main_shim_btm_api.cc [moved from bta/test/common/mock_main_shim_btm_api.cc with 100% similarity]
test/mock/mock_main_shim_entry.cc
test/mock/mock_stack_acl_btm_pm.cc
test/mock/mock_stack_crypto_toolbox_aes_cmac.cc [moved from bta/test/common/mock_stack_crypto_toolbox_aes_cmac.cc with 100% similarity]
test/mock/mock_stack_gap_ble.cc [moved from bta/test/common/mock_stack_gap_ble.cc with 100% similarity]
test/mock/mock_stack_gatt_attr.cc [moved from bta/test/common/mock_stack_gatt_attr.cc with 100% similarity]
test/mock/mock_stack_srvc_dis.cc [moved from bta/test/common/mock_stack_srvc_dis.cc with 100% similarity]
test/stub/osi.cc [moved from bta/test/common/fake_osi.cc with 100% similarity]

index c7a17d6..4b12a5d 100644 (file)
@@ -160,8 +160,19 @@ cc_test {
     host_supported: true,
     include_dirs: [
         "system/bt",
+        "system/bt/gd",
+    ],
+    generated_headers: [
+        "BluetoothGeneratedBundlerSchema_h_bfbs",
+        "BluetoothGeneratedDumpsysDataSchema_h",
+        "BluetoothGeneratedPackets_h",
     ],
     srcs: [
+        ":TestMockBtif",
+        ":TestMockDevice",
+        ":TestMockMainShim",
+        ":TestMockStack",
+        ":TestStubOsi",
         "dm/bta_dm_act.cc",
         "dm/bta_dm_cfg.cc",
         "dm/bta_dm_ci.cc",
@@ -183,39 +194,10 @@ cc_test {
         "sys/bta_sys_conn.cc",
         "sys/bta_sys_main.cc",
         "test/bta_dm_test.cc",
-        "test/common/fake_osi.cc",
-        "test/common/mock_btif_co_bta_dm_co.cc",
-        "test/common/mock_btif_co_bta_hh_co.cc",
-        "test/common/mock_btif_debug_conn.cc",
-        "test/common/mock_btif_dm.cc",
-        "test/common/mock_btif_stack_manager.cc",
-        "test/common/mock_btif_storage.cc",
-        "test/common/mock_device_controller.cc",
-        "test/common/mock_device_interop.cc",
-        "test/common/mock_main_shim_acl.cc",
-        "test/common/mock_main_shim_btm_api.cc",
-        "test/common/mock_shim.cc",
-        "test/common/mock_stack_acl.cc",
-        "test/common/mock_stack_btm.cc",
-        "test/common/mock_stack_btm_ble.cc",
-        "test/common/mock_stack_btm_dev.cc",
-        "test/common/mock_stack_btm_pm.cc",
-        "test/common/mock_stack_btm_sco.cc",
-        "test/common/mock_stack_btm_sec.cc",
-        "test/common/mock_stack_crypto_toolbox_aes_cmac.cc",
-        "test/common/mock_stack_gap_ble.cc",
-        "test/common/mock_stack_btm_main.cc",
-        "test/common/mock_stack_gatt.cc",
-        "test/common/mock_stack_gatt_attr.cc",
-        "test/common/mock_stack_gatt_connection_manager.cc",
-        "test/common/mock_stack_hidh.cc",
-        "test/common/mock_stack_l2cap.cc",
-        "test/common/mock_stack_l2cap_ble.cc",
-        "test/common/mock_stack_sdp.cc",
-        "test/common/mock_stack_srvc_dis.cc",
     ],
     shared_libs: [
         "libcrypto",
+        "libflatbuffers-cpp",
         "liblog",
         "libprotobuf-cpp-lite",
     ],
index e95b2b2..d440a5c 100644 (file)
 
 std::map<std::string, int> mock_function_count_map;
 
-bt_status_t do_in_main_thread_delayed(const base::Location& from_here,
-                                      base::OnceClosure task,
-                                      const base::TimeDelta& delay) {
-  return BT_STATUS_SUCCESS;
-}
-
-bt_status_t do_in_main_thread(const base::Location& from_here,
-                              base::OnceClosure task) {
-  return BT_STATUS_SUCCESS;
-}
-
 void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}
 
 namespace base {
 class MessageLoop;
 }  // namespace base
-bluetooth::common::MessageLoopThread* get_main_thread() { return nullptr; }
 
 namespace {
 constexpr uint8_t kUnusedTimer = BTA_ID_MAX;
diff --git a/bta/test/common/mock_btif_dm.cc b/bta/test/common/mock_btif_dm.cc
deleted file mode 100644 (file)
index f65fba0..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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:51
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "bta/include/bta_api.h"
-#include "include/hardware/bluetooth.h"
-#include "internal_include/bte_appl.h"
-#include "types/bt_transport.h"
-#include "types/raw_address.h"
-
-struct uid_set_t;
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool btif_dm_pairing_is_busy() {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool check_cod_hid(const RawAddress* remote_bdaddr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool check_sdp_bl(const RawAddress* remote_bdaddr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bt_status_t btif_dm_get_adapter_property(bt_property_t* prop) {
-  mock_function_count_map[__func__]++;
-  return BT_STATUS_SUCCESS;
-}
-bt_status_t btif_in_execute_service_request(tBTA_SERVICE_ID service_id,
-                                            bool b_enable) {
-  mock_function_count_map[__func__]++;
-  return BT_STATUS_SUCCESS;
-}
-uint16_t btif_dm_get_connection_state(const RawAddress* bd_addr) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-void BTIF_dm_disable() { mock_function_count_map[__func__]++; }
-void BTIF_dm_enable() { mock_function_count_map[__func__]++; }
-void BTIF_dm_on_hw_error() { mock_function_count_map[__func__]++; }
-void BTIF_dm_report_inquiry_status_change(uint8_t status) {
-  mock_function_count_map[__func__]++;
-}
-void bte_dm_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
-  mock_function_count_map[__func__]++;
-}
-void btif_ble_receiver_test(uint8_t rx_freq) {
-  mock_function_count_map[__func__]++;
-}
-void btif_ble_test_end() { mock_function_count_map[__func__]++; }
-void btif_ble_transmitter_test(uint8_t tx_freq, uint8_t test_data_len,
-                               uint8_t packet_payload) {
-  mock_function_count_map[__func__]++;
-}
-void btif_debug_bond_event_dump(int fd) { mock_function_count_map[__func__]++; }
-void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req, bool is_consent) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_cancel_bond(const RawAddress bd_addr) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_cancel_discovery(void) { mock_function_count_map[__func__]++; }
-void btif_dm_cleanup(void) { mock_function_count_map[__func__]++; }
-void btif_dm_create_bond(const RawAddress bd_addr, int transport) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_create_bond_out_of_band(const RawAddress bd_addr, int transport,
-                                     const bt_oob_data_t p192_data,
-                                     const bt_oob_data_t p256_data) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask,
-                                Octet16* p_er,
-                                tBTA_BLE_LOCAL_ID_KEYS* p_id_keys) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_get_remote_services(RawAddress remote_addr, const int transport) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_hh_open_failed(RawAddress* bdaddr) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_init(uid_set_t* set) { mock_function_count_map[__func__]++; }
-void btif_dm_load_ble_local_keys(void) { mock_function_count_map[__func__]++; }
-void btif_dm_on_disable() { mock_function_count_map[__func__]++; }
-void btif_dm_pin_reply(const RawAddress bd_addr, uint8_t accept,
-                       uint8_t pin_len, bt_pin_code_t pin_code) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_proc_io_req(tBTM_AUTH_REQ* p_auth_req, bool is_orig) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_proc_io_rsp(UNUSED_ATTR const RawAddress& bd_addr,
-                         tBTM_IO_CAP io_cap, UNUSED_ATTR tBTM_OOB_DATA oob_data,
-                         tBTM_AUTH_REQ auth_req) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_read_energy_info() { mock_function_count_map[__func__]++; }
-void btif_dm_remove_ble_bonding_keys(void) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_remove_bond(const RawAddress bd_addr) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_set_oob_for_io_req(tBTM_OOB_DATA* p_has_oob_data) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_set_oob_for_le_io_req(const RawAddress& bd_addr,
-                                   tBTM_OOB_DATA* p_has_oob_data,
-                                   tBTM_LE_AUTH_REQ* p_auth_req) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_ssp_reply(const RawAddress bd_addr, bt_ssp_variant_t variant,
-                       uint8_t accept) {
-  mock_function_count_map[__func__]++;
-}
-void btif_dm_start_discovery(void) { mock_function_count_map[__func__]++; }
-void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr,
-                                          BD_NAME bd_name,
-                                          tBT_DEVICE_TYPE dev_type) {
-  mock_function_count_map[__func__]++;
-}
-
-bool btif_dm_get_smp_config(tBTE_APPL_CFG* p_cfg) {
-  mock_function_count_map[__func__]++;
-  return true;
-}
-
-bool btif_dm_proc_rmt_oob(const RawAddress& bd_addr, Octet16* p_c,
-                          Octet16* p_r) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-
-void btif_dm_proc_loc_oob(tBT_TRANSPORT transport, bool is_valid,
-                          const Octet16& c, const Octet16& r) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_device_controller.cc b/bta/test/common/mock_device_controller.cc
deleted file mode 100644 (file)
index 7b0cbbc..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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:8
- */
-
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "device/include/controller.h"
-#include "hci/include/hci_layer.h"
-#include "hci/include/hci_packet_factory.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-const controller_t* controller_get_interface() {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-const controller_t* controller_get_test_interface(
-    const hci_t* hci_interface,
-    const hci_packet_factory_t* packet_factory_interface,
-    const hci_packet_parser_t* packet_parser_interface) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
diff --git a/bta/test/common/mock_shim.cc b/bta/test/common/mock_shim.cc
deleted file mode 100644 (file)
index 828da52..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-
-#define LOG_TAG "bt_shim"
-
-#include "gd/common/init_flags.h"
-#include "main/shim/shim.h"
-
-future_t* IdleModuleStartUp() { return kReturnImmediate; }
-
-future_t* ShimModuleStartUp() { return kReturnImmediate; }
-
-future_t* GeneralShutDown() { return kReturnImmediate; }
-
-bool bluetooth::shim::is_gd_advertising_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_scanning_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_security_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_acl_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_link_policy_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_hci_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_controller_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_l2cap_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_shim_enabled() {
-  return bluetooth::common::init_flags::gd_core_is_enabled();
-}
-
-bool bluetooth::shim::is_any_gd_enabled() { return false; }
-
-bool bluetooth::shim::is_gd_stack_started_up() { return false; }
diff --git a/bta/test/common/mock_stack_acl.cc b/bta/test/common/mock_stack_acl.cc
deleted file mode 100644 (file)
index ee610e9..0000000
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * 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:127
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/acl/acl.h"
-#include "stack/include/acl_api.h"
-#include "stack/include/hci_error_code.h"
-#include "types/bt_transport.h"
-#include "types/hci_role.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool IsEprAvailable(const tACL_CONN& p_acl) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool ACL_SupportTransparentSynchronousData(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsAclConnectionUp(const RawAddress& remote_bda,
-                           tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsAclConnectionUpAndHandleValid(const RawAddress& remote_bda,
-                                         tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsAclConnectionUpFromHandle(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsBleConnection(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsPhy2mSupported(const RawAddress& remote_bda,
-                          tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
-                                  RawAddress& conn_addr,
-                                  tBLE_ADDR_TYPE* p_addr_type) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version,
-                           uint16_t* manufacturer, uint16_t* lmp_sub_version) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_create_le_connection(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_is_role_switch_allowed() {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_is_switch_role_idle(const RawAddress& bd_addr,
-                             tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_peer_supports_ble_2m_phy(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_peer_supports_ble_coded_phy(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_peer_supports_ble_connection_parameters_request(
-    const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_peer_supports_ble_packet_extension(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_peer_supports_sniff_subrating(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_refresh_remote_address(const RawAddress& identity_address,
-                                tBLE_ADDR_TYPE identity_address_type,
-                                const RawAddress& bda, tBLE_ADDR_TYPE rra_type,
-                                const RawAddress& rpa) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool acl_set_peer_le_features_from_handle(uint16_t hci_handle,
-                                          const uint8_t* p) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool sco_peer_supports_esco_2m_phy(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool sco_peer_supports_esco_3m_phy(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-const RawAddress acl_address_from_handle(uint16_t handle) {
-  mock_function_count_map[__func__]++;
-  return RawAddress::kEmpty;
-}
-void acl_send_data_packet_br_edr([[maybe_unused]] const RawAddress& bd_addr,
-                                 BT_HDR* p_buf) {
-  mock_function_count_map[__func__]++;
-}
-void acl_create_classic_connection(const RawAddress& bd_addr,
-                                   bool there_are_high_priority_channels,
-                                   bool is_bonding) {
-  mock_function_count_map[__func__]++;
-}
-tACL_CONN* acl_get_connection_from_address(const RawAddress& bd_addr,
-                                           tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tACL_CONN* acl_get_connection_from_handle(uint16_t handle) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tBTM_STATUS BTM_GetLinkSuperTout(const RawAddress& remote_bda,
-                                 uint16_t* p_timeout) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, tHCI_ROLE* p_role) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda,
-                                         tBTM_CMPL_CB* p_cb) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda,
-                            tBT_TRANSPORT transport, tBTM_CMPL_CB* p_cb) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda,
-                                 uint16_t timeout) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
-                              tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint16_t BTM_GetMaxPacketSize(const RawAddress& addr) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint16_t mock_stack_acl_num_links = 0;
-uint16_t BTM_GetNumAclLinks(void) {
-  mock_function_count_map[__func__]++;
-  return mock_stack_acl_num_links;
-}
-uint16_t acl_get_supported_packet_types() {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-tHCI_REASON btm_get_acl_disc_reason_code(void) {
-  mock_function_count_map[__func__]++;
-  return HCI_SUCCESS;
-}
-uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t BTM_SetTraceLevel(uint8_t new_level) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t acl_link_role_from_handle(uint16_t handle) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t btm_handle_to_acl_index(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-void ACL_RegisterClient(struct acl_client_callback_s* callbacks) {
-  mock_function_count_map[__func__]++;
-}
-void ACL_UnregisterClient(struct acl_client_callback_s* callbacks) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_ReadConnectionAddr(const RawAddress& remote_bda,
-                            RawAddress& local_conn_addr,
-                            tBLE_ADDR_TYPE* p_addr_type) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_acl_after_controller_started(const controller_t* controller) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_block_role_switch_for(const RawAddress& peer_addr) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_block_sniff_mode_for(const RawAddress& peer_addr) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_default_block_role_switch() { mock_function_count_map[__func__]++; }
-void BTM_default_unblock_role_switch() { mock_function_count_map[__func__]++; }
-void BTM_unblock_role_switch_for(const RawAddress& peer_addr) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_unblock_sniff_mode_for(const RawAddress& peer_addr) {
-  mock_function_count_map[__func__]++;
-}
-void acl_accept_connection_request(const RawAddress& bd_addr, uint8_t role) {
-  mock_function_count_map[__func__]++;
-}
-void acl_disconnect_after_role_switch(uint16_t conn_handle,
-                                      tHCI_STATUS reason) {
-  mock_function_count_map[__func__]++;
-}
-void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason) {
-  mock_function_count_map[__func__]++;
-}
-void acl_link_segments_xmitted(BT_HDR_RIGID* p_msg) {
-  mock_function_count_map[__func__]++;
-}
-void acl_packets_completed(uint16_t handle, uint16_t credits) {
-  mock_function_count_map[__func__]++;
-}
-void acl_process_supported_features(uint16_t handle, uint64_t features) {
-  mock_function_count_map[__func__]++;
-}
-void acl_process_extended_features(uint16_t handle, uint8_t current_page_number,
-                                   uint8_t max_page_number, uint64_t features) {
-  mock_function_count_map[__func__]++;
-}
-void acl_process_num_completed_pkts(uint8_t* p, uint8_t evt_len) {
-  mock_function_count_map[__func__]++;
-}
-void acl_rcv_acl_data(BT_HDR_RIGID* p_msg) {
-  mock_function_count_map[__func__]++;
-}
-void acl_reject_connection_request(const RawAddress& bd_addr, uint8_t reason) {
-  mock_function_count_map[__func__]++;
-}
-void acl_send_data_packet_ble(const RawAddress& bd_addr, BT_HDR* p_buf) {
-  mock_function_count_map[__func__]++;
-}
-void acl_set_disconnect_reason(tHCI_STATUS acl_disc_reason) {
-  mock_function_count_map[__func__]++;
-}
-void acl_write_automatic_flush_timeout(const RawAddress& bd_addr,
-                                       uint16_t flush_timeout_in_ticks) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p, uint16_t* p_pkt_type) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_connected(const RawAddress& bda, uint16_t handle,
-                       tHCI_STATUS status, uint8_t enc_mode) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_connection_request(const RawAddress& bda, uint8_t* dc) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_created(const RawAddress& bda, uint16_t hci_handle,
-                     tHCI_ROLE link_role, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_device_down(void) { mock_function_count_map[__func__]++; }
-void btm_acl_disconnected(tHCI_STATUS status, uint16_t handle,
-                          tHCI_REASON reason) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
-                            uint8_t encr_enable) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_notif_conn_collision(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_paging(BT_HDR* p, const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_process_sca_cmpl_pkt(uint8_t len, uint8_t* data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_removed(uint16_t handle) { mock_function_count_map[__func__]++; }
-void btm_acl_reset_paging(void) { mock_function_count_map[__func__]++; }
-void btm_acl_resubmit_page(void) { mock_function_count_map[__func__]++; }
-void btm_acl_role_changed(tHCI_STATUS hci_status, const RawAddress& bd_addr,
-                          tHCI_ROLE new_role) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_set_paging(bool value) { mock_function_count_map[__func__]++; }
-void btm_acl_update_conn_addr(uint16_t handle, const RawAddress& address) {
-  mock_function_count_map[__func__]++;
-}
-void btm_acl_update_inquiry_status(uint8_t status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_refresh_local_resolvable_private_addr(
-    const RawAddress& pseudo_addr, const RawAddress& local_rpa) {
-  mock_function_count_map[__func__]++;
-}
-void btm_cont_rswitch_from_handle(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_establish_continue_from_address(const RawAddress& bda,
-                                         tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-}
-void btm_process_remote_ext_features(tACL_CONN* p_acl_cb,
-                                     uint8_t max_page_number) {
-  mock_function_count_map[__func__]++;
-}
-void btm_process_remote_version_complete(uint8_t status, uint16_t handle,
-                                         uint8_t lmp_version,
-                                         uint16_t manufacturer,
-                                         uint16_t lmp_subversion) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_automatic_flush_timeout_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_failed_contact_counter_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_failed_contact_counter_timeout(UNUSED_ATTR void* data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_link_quality_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_link_quality_timeout(UNUSED_ATTR void* data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_ext_features(uint16_t handle, uint8_t page_number) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_ext_features_complete(uint16_t handle, uint8_t page_num,
-                                           uint8_t max_page,
-                                           uint8_t* features) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_ext_features_complete_raw(uint8_t* p, uint8_t evt_len) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_ext_features_failed(uint8_t status, uint16_t handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_features_complete(uint16_t handle, uint8_t* features) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_features_complete_raw(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_version_complete(tHCI_STATUS status, uint16_t handle,
-                                      uint8_t lmp_version,
-                                      uint16_t manufacturer,
-                                      uint16_t lmp_subversion) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_remote_version_complete_raw(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_rssi_complete(uint8_t* p) { mock_function_count_map[__func__]++; }
-void btm_read_rssi_timeout(UNUSED_ATTR void* data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_tx_power_complete(uint8_t* p, bool is_ble) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_tx_power_timeout(UNUSED_ATTR void* data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_rejectlist_role_change_device(const RawAddress& bd_addr,
-                                       uint8_t hci_status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_set_link_policy(tACL_CONN* conn, tLINK_POLICY policy) {
-  mock_function_count_map[__func__]++;
-}
-void btm_set_packet_types_from_address(const RawAddress& bd_addr,
-                                       uint16_t pkt_types) {
-  mock_function_count_map[__func__]++;
-}
-void hci_btm_set_link_supervision_timeout(tACL_CONN& link, uint16_t timeout) {
-  mock_function_count_map[__func__]++;
-}
-void on_acl_br_edr_connected(const RawAddress& bda, uint16_t handle,
-                             uint8_t enc_mode) {
-  mock_function_count_map[__func__]++;
-}
-void on_acl_br_edr_failed(const RawAddress& bda, tHCI_STATUS status) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_btm.cc b/bta/test/common/mock_stack_btm.cc
deleted file mode 100644 (file)
index 3f8d1ca..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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
- */
-
-#include "stack/include/btm_ble_api_types.h"
-#include "stack/include/btm_client_interface.h"
-#include "types/raw_address.h"
-
-bool BTM_HasEirService(const uint32_t* p_eir_uuid, uint16_t uuid16) {
-  return false;
-}
-tBTM_INQ_INFO* BTM_InqDbFirst(void) { return nullptr; }
-tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur) { return nullptr; }
-tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda) { return nullptr; }
-tBTM_STATUS BTM_CancelRemoteDeviceName(void) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_ReadLocalDeviceNameFromController(
-    tBTM_CMPL_CB* p_rln_cmpl_cback) {
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
-                                     tBTM_CMPL_CB* p_cb,
-                                     tBT_TRANSPORT transport) {
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_SetLocalDeviceName(char* p_name) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
-                             tBTM_CMPL_CB* p_cmpl_cb) {
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) { return BTM_SUCCESS; }
-tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback) {
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration,
-                           tBTM_INQ_RESULTS_CB* p_results_cb,
-                           tBTM_CMPL_CB* p_cmpl_cb) {
-  return BTM_SUCCESS;
-}
-uint16_t BTM_IsInquiryActive(void) { return 0; }
-uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
-                                    uint8_t max_num_uuid16,
-                                    uint8_t* p_num_uuid16) {
-  return 0;
-}
-void BTM_AddEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {}
-void BTM_BleReadControllerFeatures(tBTM_BLE_CTRL_FEATURES_CBACK* p_vsc_cback) {}
-void BTM_CancelInquiry(void) {}
-void BTM_RemoveEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {}
-void BTM_WritePageTimeout(uint16_t timeout) {}
-bool BTM_BleConfigPrivacy(bool enable) { return false; }
-bool BTM_IsDeviceUp() { return false; }
-bool BTM_is_sniff_allowed_for(const RawAddress& peer_addr) { return false; }
-void btm_ble_adv_init() {}
-tBTM_STATUS BTM_ReadLocalDeviceName(char** p_name) { return BTM_SUCCESS; }
-uint8_t BTM_GetAcceptlistSize() { return 0; }
-
-struct btm_client_interface_s btm_client_interface = {};
-
-struct btm_client_interface_s& get_btm_client_interface() {
-  return btm_client_interface;
-}
diff --git a/bta/test/common/mock_stack_btm_ble.cc b/bta/test/common/mock_stack_btm_ble.cc
deleted file mode 100644 (file)
index a39c780..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * 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:50
- */
-
-#include <base/bind.h>
-#include <base/callback.h>
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/btm/btm_ble_int_types.h"
-#include "stack/btm/btm_int_types.h"
-#include "stack/btm/security_device_record.h"
-#include "stack/include/bt_types.h"
-#include "stack/include/btm_api_types.h"
-#include "stack/include/btm_ble_api_types.h"
-#include "stack/include/l2cdefs.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-void btm_ble_reset_id(void) { mock_function_count_map[__func__]++; }
-bool BTM_BleDataSignature(const RawAddress& bd_addr, uint8_t* p_text,
-                          uint16_t len, BLE_SIGNATURE signature) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_BleVerifySignature(const RawAddress& bd_addr, uint8_t* p_orig,
-                            uint16_t len, uint32_t counter, uint8_t* p_comp) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_ReadConnectedTransportAddress(RawAddress* remote_bda,
-                                       tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_UseLeLink(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_ble_get_acl_remote_addr(uint16_t hci_handle, RawAddress& conn_addr,
-                                 tBLE_ADDR_TYPE* p_addr_type) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_ble_get_enc_key_type(const RawAddress& bd_addr, uint8_t* p_key_types) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_get_local_div(const RawAddress& bd_addr, uint16_t* p_div) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-namespace {
-Octet16 octet16;
-}
-
-const Octet16& BTM_GetDeviceDHK() {
-  mock_function_count_map[__func__]++;
-  return octet16;
-}
-const Octet16& BTM_GetDeviceEncRoot() {
-  mock_function_count_map[__func__]++;
-  return octet16;
-}
-const Octet16& BTM_GetDeviceIDRoot() {
-  mock_function_count_map[__func__]++;
-  return octet16;
-}
-tBTM_SEC_ACTION btm_ble_determine_security_act(bool is_originator,
-                                               const RawAddress& bdaddr,
-                                               uint16_t security_required) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr,
-                                 uint16_t tx_pdu_length) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr,
-                                   tBTM_BLE_SEC_ACT sec_act,
-                                   uint8_t link_role) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk,
-                                  Octet16* p_stk) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tL2CAP_LE_RESULT_CODE btm_ble_start_sec_check(const RawAddress& bd_addr,
-                                              uint16_t psm, bool is_originator,
-                                              tBTM_SEC_CALLBACK* p_callback,
-                                              void* p_ref_data) {
-  mock_function_count_map[__func__]++;
-  return L2CAP_LE_RESULT_CONN_OK;
-}
-uint8_t btm_ble_br_keys_req(tBTM_SEC_DEV_REC* p_dev_rec,
-                            tBTM_LE_IO_REQ* p_data) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t btm_ble_io_capabilities_req(tBTM_SEC_DEV_REC* p_dev_rec,
-                                    tBTM_LE_IO_REQ* p_data) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t btm_ble_read_sec_key_size(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-tSMP_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr,
-                               tSMP_EVT_DATA* p_data) {
-  mock_function_count_map[__func__]++;
-  return SMP_SUCCESS;
-}
-void BTM_BleConfirmReply(const RawAddress& bd_addr, uint8_t res) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleLoadLocalKeys(uint8_t key_type, tBTM_BLE_LOCAL_KEYS* p_key) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleOobDataReply(const RawAddress& bd_addr, uint8_t res, uint8_t len,
-                         uint8_t* p_data) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BlePasskeyReply(const RawAddress& bd_addr, uint8_t res,
-                         uint32_t passkey) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleReadPhy(
-    const RawAddress& bd_addr,
-    base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)> cb) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleReceiverTest(uint8_t rx_freq, tBTM_CMPL_CB* p_cmd_cmpl_cback) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleSecureConnectionOobDataReply(const RawAddress& bd_addr,
-                                         uint8_t* p_c, uint8_t* p_r) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleSetPhy(const RawAddress& bd_addr, uint8_t tx_phys, uint8_t rx_phys,
-                   uint16_t phy_options) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleSetPrefConnParams(const RawAddress& bd_addr, uint16_t min_conn_int,
-                              uint16_t max_conn_int,
-                              uint16_t peripheral_latency,
-                              uint16_t supervision_tout) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleTestEnd(tBTM_CMPL_CB* p_cmd_cmpl_cback) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_BleTransmitterTest(uint8_t tx_freq, uint8_t test_data_len,
-                            uint8_t packet_payload,
-                            tBTM_CMPL_CB* p_cmd_cmpl_cback) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_ReadDevInfo(const RawAddress& remote_bda, tBT_DEVICE_TYPE* p_dev_type,
-                     tBLE_ADDR_TYPE* p_addr_type) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_SecAddBleDevice(const RawAddress& bd_addr, tBT_DEVICE_TYPE dev_type,
-                         tBLE_ADDR_TYPE addr_type) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_SecAddBleKey(const RawAddress& bd_addr, tBTM_LE_KEY_VALUE* p_le_key,
-                      tBTM_LE_KEY_TYPE key_type) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_SecurityGrant(const RawAddress& bd_addr, uint8_t res) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,
-                       uint8_t role, tBLE_ADDR_TYPE addr_type,
-                       bool addr_matched) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_connected_from_address_with_type(
-    const tBLE_BD_ADDR& address_with_type, uint16_t handle, uint8_t enc_mode,
-    uint8_t role, bool addr_matched) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_increment_sign_ctr(const RawAddress& bd_addr, bool is_local) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_link_sec_check(const RawAddress& bd_addr,
-                            tBTM_LE_AUTH_REQ auth_req,
-                            tBTM_BLE_SEC_REQ_ACT* p_sec_req_act) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_ltk_request(uint16_t handle, uint8_t rand[8], uint16_t ediv) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_ltk_request_reply(const RawAddress& bda, bool use_stk,
-                               const Octet16& stk) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_rand_enc_complete(uint8_t* p, uint16_t op_code,
-                               tBTM_RAND_ENC_CB* p_enc_cplt_cback) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_set_random_address(const RawAddress& random_bda) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_test_command_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_ble_update_sec_key_size(const RawAddress& bd_addr,
-                                 uint8_t enc_key_size) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_save_le_key(const RawAddress& bd_addr, tBTM_LE_KEY_TYPE key_type,
-                         tBTM_LE_KEY_VALUE* p_keys, bool pass_to_application) {
-  mock_function_count_map[__func__]++;
-}
-void doNothing(uint8_t* data, uint16_t len) {
-  mock_function_count_map[__func__]++;
-}
-void read_phy_cb(
-    base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)> cb,
-    uint8_t* data, uint16_t len) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_btm_dev.cc b/bta/test/common/mock_stack_btm_dev.cc
deleted file mode 100644 (file)
index 692fcfd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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:12
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/btm/security_device_record.h"
-#include "stack/include/bt_types.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
-                      BD_NAME bd_name, uint8_t* features, LinkKey* p_link_key,
-                      uint8_t key_type, uint8_t pin_length) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SecDeleteDevice(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) {
-  mock_function_count_map[__func__]++;
-}
-char* BTM_SecReadDevName(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-void BTM_SecClearSecurityFlags(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_btm_main.cc b/bta/test/common/mock_stack_btm_main.cc
deleted file mode 100644 (file)
index e614cc3..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2020 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:7
- */
-
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include <memory>
-#include <string>
-#include "bt_target.h"
-#include "bt_types.h"
-#include "main/shim/dumpsys.h"
-#include "stack/btm/btm_int_types.h"
-#include "stack/include/btm_client_interface.h"
-#include "stack_config.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-void BTM_LogHistory(const std::string& tag, const RawAddress& bd_addr,
-                    const std::string& msg) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_LogHistory(const std::string& tag, const RawAddress& bd_addr,
-                    const std::string& msg, const std::string& extra) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_LogHistory(const std::string& tag, const tBLE_BD_ADDR& ble_bd_addr,
-                    const std::string& msg) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_LogHistory(const std::string& tag, const tBLE_BD_ADDR& ble_bd_addr,
-                    const std::string& msg, const std::string& extra) {
-  mock_function_count_map[__func__]++;
-}
-void btm_free(void) { mock_function_count_map[__func__]++; }
-void btm_init(void) { mock_function_count_map[__func__]++; }
diff --git a/bta/test/common/mock_stack_btm_pm.cc b/bta/test/common/mock_stack_btm_pm.cc
deleted file mode 100644 (file)
index 62a9f4f..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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:17
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/include/btm_api_types.h"
-#include "stack/include/btm_status.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-tBTM_CONTRL_STATE BTM_PM_ReadControllerState(void) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id,
-                           tBTM_PM_STATUS_CBACK* p_cb) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
-                             const tBTM_PM_PWR_MD* p_mode) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
-                             uint16_t min_rmt_to, uint16_t min_loc_to) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-void BTM_PM_OnConnected(uint16_t handle, const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_PM_OnDisconnected(uint16_t handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
-                           tHCI_MODE current_mode, uint16_t interval) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_on_sniff_subrating(tHCI_STATUS status, uint16_t handle,
-                               uint16_t maximum_transmit_latency,
-                               uint16_t maximum_receive_latency,
-                               uint16_t minimum_remote_timeout,
-                               uint16_t minimum_local_timeout) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_proc_cmd_status(tHCI_STATUS status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_proc_mode_change(tHCI_STATUS hci_status, uint16_t hci_handle,
-                             tHCI_MODE hci_mode, uint16_t interval) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_proc_ssr_evt(uint8_t* p, UNUSED_ATTR uint16_t evt_len) {
-  mock_function_count_map[__func__]++;
-}
-void btm_pm_reset(void) { mock_function_count_map[__func__]++; }
-void process_ssr_event(tHCI_STATUS status, uint16_t handle,
-                       UNUSED_ATTR uint16_t max_tx_lat, uint16_t max_rx_lat) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_btm_sco.cc b/bta/test/common/mock_stack_btm_sco.cc
deleted file mode 100644 (file)
index ac43989..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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:23
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/include/btm_api_types.h"
-#include "stack/include/btm_status.h"
-#include "stack/include/hci_error_code.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool BTM_IsScoActiveByBdaddr(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_is_sco_active(uint16_t handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_sco_removed(uint16_t hci_handle, tHCI_REASON reason) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx,
-                                    tBTM_CHG_ESCO_PARAMS* p_parms) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
-                          uint16_t pkt_types, uint16_t* p_sco_inx,
-                          tBTM_SCO_CB* p_conn_cb, tBTM_SCO_CB* p_disc_cb) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx,
-                               tBTM_ESCO_CBACK* p_esco_cback) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-uint8_t BTM_GetNumScoLinks(void) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-void BTM_EScoConnRsp(uint16_t sco_inx, uint8_t hci_status,
-                     enh_esco_params_t* p_parms) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_RemoveSco(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-}
-void btm_esco_proc_conn_chg(uint8_t status, uint16_t handle,
-                            uint8_t tx_interval, uint8_t retrans_window,
-                            uint16_t rx_pkt_len, uint16_t tx_pkt_len) {
-  mock_function_count_map[__func__]++;
-}
-void btm_route_sco_data(BT_HDR_RIGID* p_msg) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_acl_removed(const RawAddress* bda) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_chk_pend_rolechange(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_chk_pend_unpark(tHCI_STATUS hci_status, uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_conn_req(const RawAddress& bda, const DEV_CLASS& dev_class,
-                      uint8_t link_type) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_connected(tHCI_STATUS hci_status, const RawAddress& bda,
-                       uint16_t hci_handle, tBTM_ESCO_DATA* p_esco_data) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_disc_chk_pend_for_modechange(uint16_t hci_handle) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sco_on_disconnected(uint16_t hci_handle, tHCI_REASON reason) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_btm_sec.cc b/bta/test/common/mock_stack_btm_sec.cc
deleted file mode 100644 (file)
index 4c68bfc..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * 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:66
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/btm/security_device_record.h"
-#include "stack/include/btm_status.h"
-#include "stack/include/hci_error_code.h"
-#include "stack/include/security_client_callbacks.h"
-#include "types/bt_transport.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool BTM_BothEndsSupportSecureConnections(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_GetSecurityFlags(const RawAddress& bd_addr, uint8_t* p_sec_flags) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_GetSecurityFlagsByTransport(const RawAddress& bd_addr,
-                                     uint8_t* p_sec_flags,
-                                     tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsAuthenticated(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsEncrypted(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsLinkKeyAuthed(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_IsLinkKeyKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_PeerSupportsSecureConnections(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SecAddRmtNameNotifyCallback(tBTM_RMT_NAME_CALLBACK* p_callback) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SecDeleteRmtNameNotifyCallback(tBTM_RMT_NAME_CALLBACK* p_callback) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SecIsSecurityPending(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SecRegister(const tBTM_APPL_INFO* p_cb_info) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool BTM_SetSecurityLevel(bool is_originator, const char* p_name,
-                          uint8_t service_id, uint16_t sec_level, uint16_t psm,
-                          uint32_t mx_proto_id, uint32_t mx_chan_id) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool btm_sec_is_a_bonded_dev(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool is_sec_state_equal(void* data, void* context) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool is_state_getting_name(void* data, void* context) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-const uint8_t* btm_get_dev_class(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tBTM_LINK_KEY_TYPE BTM_SecGetDeviceLinkKeyType(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-tBTM_SEC_DEV_REC* btm_sec_find_dev_by_sec_state(uint8_t state) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tBTM_SEC_SERV_REC* btm_sec_find_first_serv(bool is_originator, uint16_t psm) {
-  mock_function_count_map[__func__]++;
-  return nullptr;
-}
-tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
-                        tBT_TRANSPORT transport, int device_type,
-                        uint8_t pin_len, uint8_t* p_pin) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SecBondCancel(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
-                              tBT_TRANSPORT transport,
-                              tBTM_SEC_CALLBACK* p_callback, void* p_ref_data,
-                              tBTM_BLE_SEC_ACT sec_act) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
-                                      tBT_TRANSPORT transport, uint8_t pin_len,
-                                      uint8_t* p_pin) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_disconnect(uint16_t handle, tHCI_STATUS reason) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_l2cap_access_req(const RawAddress& bd_addr, uint16_t psm,
-                                     bool is_originator,
-                                     tBTM_SEC_CALLBACK* p_callback,
-                                     void* p_ref_data) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(
-    const RawAddress& bd_addr, uint16_t security_required, bool is_originator,
-    tBTM_SEC_CALLBACK* p_callback, void* p_ref_data) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr,
-                                      bool is_originator,
-                                      uint16_t security_required,
-                                      tBTM_SEC_CALLBACK* p_callback,
-                                      void* p_ref_data) {
-  mock_function_count_map[__func__]++;
-  return BTM_SUCCESS;
-}
-uint16_t BTM_GetClockOffset(const RawAddress& remote_bda) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t BTM_SecClrService(uint8_t service_id) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-uint8_t BTM_SecClrServiceByPsm(uint16_t psm) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-void BTM_ConfirmReqReply(tBTM_STATUS res, const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_PINCodeReply(const RawAddress& bd_addr, uint8_t res, uint8_t pin_len,
-                      uint8_t* p_pin) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_PasskeyReqReply(tBTM_STATUS res, const RawAddress& bd_addr,
-                         uint32_t passkey) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_ReadLocalOobData(void) { mock_function_count_map[__func__]++; }
-void BTM_RemoteOobDataReply(tBTM_STATUS res, const RawAddress& bd_addr,
-                            const Octet16& c, const Octet16& r) {
-  mock_function_count_map[__func__]++;
-}
-void BTM_SetPinType(uint8_t pin_type, PIN_CODE pin_code, uint8_t pin_code_len) {
-  mock_function_count_map[__func__]++;
-}
-void NotifyBondingCanceled(tBTM_STATUS btm_status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_create_conn_cancel_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_inq_stop_on_ssp(void) {}
-void btm_io_capabilities_req(const RawAddress& p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_io_capabilities_rsp(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_proc_sp_req_evt(tBTM_SP_EVT event, uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_read_local_oob_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_rem_oob_req(uint8_t* p) { mock_function_count_map[__func__]++; }
-void btm_sec_abort_access_req(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_check_pending_reqs(void) { mock_function_count_map[__func__]++; }
-void btm_sec_clear_ble_keys(tBTM_SEC_DEV_REC* p_dev_rec) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_conn_req(const RawAddress& bda, uint8_t* dc) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_connected(const RawAddress& bda, uint16_t handle,
-                       tHCI_STATUS status, uint8_t enc_mode) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_dev_rec_cback_event(tBTM_SEC_DEV_REC* p_dev_rec,
-                                 tBTM_STATUS btm_status, bool is_le_transport) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_dev_reset(void) { mock_function_count_map[__func__]++; }
-void btm_sec_disconnected(uint16_t handle, tHCI_STATUS reason) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
-                            uint8_t encr_enable) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_link_key_notification(const RawAddress& p_bda,
-                                   const Octet16& link_key, uint8_t key_type) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_link_key_request(uint8_t* p_event) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_pin_code_request(uint8_t* p_event) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_rmt_host_support_feat_evt(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr,
-                                       uint8_t* p_bd_name, tHCI_STATUS status) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_set_peer_sec_caps(uint16_t hci_handle, bool ssp_supported,
-                               bool sc_supported,
-                               bool hci_role_switch_supported) {
-  mock_function_count_map[__func__]++;
-}
-void btm_sec_update_clock_offset(uint16_t handle, uint16_t clock_offset) {
-  mock_function_count_map[__func__]++;
-}
-void btm_simple_pair_complete(uint8_t* p) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_gatt.cc b/bta/test/common/mock_stack_gatt.cc
deleted file mode 100644 (file)
index 6ae3c8e..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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:27
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-#include "stack/gatt/gatt_int.h"
-#include "stack/include/gatt_api.h"
-#include "types/bluetooth/uuid.h"
-#include "types/bt_transport.h"
-#include "types/raw_address.h"
-
-using namespace bluetooth;
-
-extern std::map<std::string, int> mock_function_count_map;
-tGATT_HDL_LIST_ELEM elem;  // gatt_add_an_item_to_list
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool GATTS_DeleteService(tGATT_IF gatt_if, Uuid* p_svc_uuid,
-                         uint16_t svc_inst) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATTS_NVRegister(tGATT_APPL_INFO* p_cb_info) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATT_CancelConnect(tGATT_IF gatt_if, const RawAddress& bd_addr,
-                        bool is_direct) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
-                  tBT_TRANSPORT transport, bool opportunistic) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
-                  tBT_TRANSPORT transport, bool opportunistic,
-                  uint8_t initiating_phys) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATT_GetConnIdIfConnected(tGATT_IF gatt_if, const RawAddress& bd_addr,
-                               uint16_t* p_conn_id, tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool GATT_GetConnectionInfor(uint16_t conn_id, tGATT_IF* p_gatt_if,
-                             RawAddress& bd_addr, tBT_TRANSPORT* p_transport) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool is_active_service(const Uuid& app_uuid128, Uuid* p_svc_uuid,
-                       uint16_t start_handle) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-tGATT_HDL_LIST_ELEM& gatt_add_an_item_to_list(uint16_t s_handle) {
-  mock_function_count_map[__func__]++;
-  return elem;
-}
-tGATT_IF GATT_Register(const Uuid& app_uuid128, tGATT_CBACK* p_cb_info,
-                       bool eatt_support) {
-  mock_function_count_map[__func__]++;
-  return 0;
-}
-tGATT_STATUS GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_Discover(uint16_t conn_id, tGATT_DISC_TYPE disc_type,
-                            uint16_t start_handle, uint16_t end_handle) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_Discover(uint16_t conn_id, tGATT_DISC_TYPE disc_type,
-                            uint16_t start_handle, uint16_t end_handle,
-                            const Uuid& uuid) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_ExecuteWrite(uint16_t conn_id, bool is_execute) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_Read(uint16_t conn_id, tGATT_READ_TYPE type,
-                        tGATT_READ_PARAM* p_read) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_SendHandleValueConfirm(uint16_t conn_id, uint16_t cid) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTC_Write(uint16_t conn_id, tGATT_WRITE_TYPE type,
-                         tGATT_VALUE* p_write) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTS_AddService(tGATT_IF gatt_if, btgatt_db_element_t* service,
-                              int count) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_handle,
-                                         uint16_t val_len, uint8_t* p_val) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTS_HandleValueNotification(uint16_t conn_id,
-                                           uint16_t attr_handle,
-                                           uint16_t val_len, uint8_t* p_val) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATTS_SendRsp(uint16_t conn_id, uint32_t trans_id,
-                           tGATT_STATUS status, tGATTS_RSP* p_msg) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-tGATT_STATUS GATT_Disconnect(uint16_t conn_id) {
-  mock_function_count_map[__func__]++;
-  return GATT_SUCCESS;
-}
-void GATTS_AddHandleRange(tGATTS_HNDL_RANGE* p_hndl_range) {
-  mock_function_count_map[__func__]++;
-}
-void GATTS_StopService(uint16_t service_handle) {
-  mock_function_count_map[__func__]++;
-}
-void GATT_Deregister(tGATT_IF gatt_if) { mock_function_count_map[__func__]++; }
-void GATT_SetIdleTimeout(const RawAddress& bd_addr, uint16_t idle_tout,
-                         tBT_TRANSPORT transport) {
-  mock_function_count_map[__func__]++;
-}
-void GATT_StartIf(tGATT_IF gatt_if) { mock_function_count_map[__func__]++; }
diff --git a/bta/test/common/mock_stack_gatt_connection_manager.cc b/bta/test/common/mock_stack_gatt_connection_manager.cc
deleted file mode 100644 (file)
index 1c4887c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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:4
- */
-
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/gatt/connection_manager.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-namespace connection_manager {
-
-void reset(bool after_reset) { mock_function_count_map[__func__]++; }
-
-}  // namespace connection_manager
diff --git a/bta/test/common/mock_stack_hidh.cc b/bta/test/common/mock_stack_hidh.cc
deleted file mode 100644 (file)
index 79cbcc4..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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:11
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/include/hiddefs.h"
-#include "stack/include/hidh_api.h"
-#include "stack/include/sdp_api.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-tHID_STATUS HID_HostAddDev(const RawAddress& addr, uint16_t attr_mask,
-                           uint8_t* handle) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostCloseDev(uint8_t dev_handle) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostDeregister(void) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostGetSDPRecord(const RawAddress& addr,
-                                 tSDP_DISCOVERY_DB* p_db, uint32_t db_len,
-                                 tHID_HOST_SDP_CALLBACK* sdp_cback) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostOpenDev(uint8_t dev_handle) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostRegister(tHID_HOST_DEV_CALLBACK* dev_cback) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostRemoveDev(uint8_t dev_handle) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-tHID_STATUS HID_HostWriteDev(uint8_t dev_handle, uint8_t t_type, uint8_t param,
-                             uint16_t data, uint8_t report_id, BT_HDR* pbuf) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-uint8_t HID_HostSetTraceLevel(uint8_t new_level) {
-  mock_function_count_map[__func__]++;
-  return HID_SUCCESS;
-}
-void HID_HostInit(void) { mock_function_count_map[__func__]++; }
-void hidh_get_str_attr(tSDP_DISC_REC* p_rec, uint16_t attr_id, uint16_t max_len,
-                       char* str) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_l2cap.cc b/bta/test/common/mock_stack_l2cap.cc
deleted file mode 100644 (file)
index bc21b66..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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
- */
-
-#include <cstdint>
-#include <string>
-
-#include "btm_sec.h"
-#include "main/shim/l2c_api.h"
-#include "main/shim/shim.h"
-#include "osi/include/log.h"
-#include "stack/include/l2c_api.h"
-#include "stack/l2cap/l2c_int.h"
-
-tBT_TRANSPORT l2c_get_transport_from_fixed_cid(uint16_t fixed_cid) {
-  if (fixed_cid >= L2CAP_ATT_CID && fixed_cid <= L2CAP_SMP_CID)
-    return BT_TRANSPORT_LE;
-  return BT_TRANSPORT_BR_EDR;
-}
-
-uint16_t L2CA_Register2(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
-                        bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info,
-                        uint16_t my_mtu, uint16_t required_remote_mtu,
-                        uint16_t sec_level) {
-  auto ret = L2CA_Register(psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu,
-                           required_remote_mtu, sec_level);
-  BTM_SetSecurityLevel(false, "", 0, sec_level, psm, 0, 0);
-  return ret;
-}
-
-uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
-                       bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info,
-                       uint16_t my_mtu, uint16_t required_remote_mtu,
-                       uint16_t sec_level) {
-  return 0;
-}
-
-void L2CA_Deregister(uint16_t psm) {}
-
-uint16_t L2CA_AllocateLePSM(void) { return 0; }
-
-void L2CA_FreeLePSM(uint16_t psm) {}
-
-uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
-                          uint16_t sec_level) {
-  return 0;
-}
-
-uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr) {
-  return 0;
-}
-
-uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
-                            uint16_t sec_level, tL2CAP_LE_CFG_INFO cfg) {
-  return 0;
-}
-
-void L2CA_DeregisterLECoc(uint16_t psm) {}
-
-uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr,
-                              tL2CAP_LE_CFG_INFO* p_cfg, uint16_t sec_level) {
-  return 0;
-}
-
-bool L2CA_GetPeerLECocConfig(uint16_t lcid, tL2CAP_LE_CFG_INFO* peer_cfg) {
-  return false;
-}
-
-bool L2CA_ConnectCreditBasedRsp(const RawAddress& p_bd_addr, uint8_t id,
-                                std::vector<uint16_t>& accepted_lcids,
-                                uint16_t result, tL2CAP_LE_CFG_INFO* p_cfg) {
-  return false;
-}
-
-std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm,
-                                                 const RawAddress& p_bd_addr,
-                                                 tL2CAP_LE_CFG_INFO* p_cfg) {
-  return std::vector<uint16_t>();
-}
-
-bool L2CA_ReconfigCreditBasedConnsReq(const RawAddress& bda,
-                                      std::vector<uint16_t>& lcids,
-                                      tL2CAP_LE_CFG_INFO* p_cfg) {
-  return false;
-}
-
-bool L2CA_DisconnectReq(uint16_t cid) { return false; }
-
-bool L2CA_DisconnectLECocReq(uint16_t cid) { return false; }
-
-bool L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid) { return false; }
-
-bool L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr, uint16_t timeout,
-                                 tBT_TRANSPORT transport) {
-  return false;
-}
-uint8_t L2CA_SetTraceLevel(uint8_t new_level) { return 0; }
-
-bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
-  return false;
-}
-
-bool L2CA_SetTxPriority(uint16_t cid, tL2CAP_CHNL_PRIORITY priority) {
-  return false;
-}
-
-bool L2CA_GetPeerFeatures(const RawAddress& bd_addr, uint32_t* p_ext_feat,
-                          uint8_t* p_chnl_mask) {
-  return false;
-}
-
-bool L2CA_RegisterFixedChannel(uint16_t fixed_cid,
-                               tL2CAP_FIXED_CHNL_REG* p_freg) {
-  return false;
-}
-
-bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) {
-  return false;
-}
-
-uint16_t L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& rem_bda,
-                                BT_HDR* p_buf) {
-  return 0;
-}
-
-bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) {
-  return false;
-}
-
-bool L2CA_SetLeGattTimeout(const RawAddress& rem_bda, uint16_t idle_tout) {
-  return false;
-}
-
-uint8_t L2CA_DataWrite(uint16_t cid, BT_HDR* p_data) { return 0; }
-
-uint8_t L2CA_LECocDataWrite(uint16_t cid, BT_HDR* p_data) { return 0; }
-
-bool L2CA_SetChnlFlushability(uint16_t cid, bool is_flushable) { return false; }
-
-uint16_t L2CA_FlushChannel(uint16_t lcid, uint16_t num_to_flush) { return 0; }
-
-bool L2CA_IsLinkEstablished(const RawAddress& bd_addr,
-                            tBT_TRANSPORT transport) {
-  return false;
-}
diff --git a/bta/test/common/mock_stack_l2cap_ble.cc b/bta/test/common/mock_stack_l2cap_ble.cc
deleted file mode 100644 (file)
index 70590f2..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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:22
- */
-
-#include <cstdint>
-#include <map>
-#include <string>
-
-extern std::map<std::string, int> mock_function_count_map;
-
-#include "stack/l2cap/l2c_int.h"
-#include "types/hci_role.h"
-#include "types/raw_address.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
-bool L2CA_EnableUpdateBleConnParams(const RawAddress& rem_bda, bool enable) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int,
-                              uint16_t max_int, uint16_t latency,
-                              uint16_t timeout, uint16_t min_ce_len,
-                              uint16_t max_ce_len) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
-                      tBLE_ADDR_TYPE type, uint16_t conn_interval,
-                      uint16_t conn_latency, uint16_t conn_timeout) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool l2cble_conn_comp_from_address_with_type(
-    uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
-    uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-bool l2cble_create_conn(tL2C_LCB* p_lcb) {
-  mock_function_count_map[__func__]++;
-  return false;
-}
-hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
-  mock_function_count_map[__func__]++;
-  return HCI_ROLE_CENTRAL;
-}
-tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr,
-                                           uint16_t psm, bool is_originator,
-                                           tL2CAP_SEC_CBACK* p_callback,
-                                           void* p_ref_data) {
-  mock_function_count_map[__func__]++;
-  return L2CAP_LE_RESULT_CONN_OK;
-}
-void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
-                                    uint16_t* max_interval,
-                                    uint16_t floor_interval) {
-  mock_function_count_map[__func__]++;
-}
-void l2c_ble_link_adjust_allocation(void) {
-  mock_function_count_map[__func__]++;
-}
-void l2c_link_processs_ble_num_bufs(uint16_t num_lm_ble_bufs) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, uint16_t result) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_notify_le_connection(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status,
-                                    uint16_t interval, uint16_t latency,
-                                    uint16_t timeout) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_process_data_length_change_event(uint16_t handle,
-                                             uint16_t tx_data_len,
-                                             uint16_t rx_data_len) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min,
-                                         uint16_t int_max, uint16_t latency,
-                                         uint16_t timeout) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_sec_comp(const RawAddress* bda, tBT_TRANSPORT transport,
-                     void* p_ref_data, uint8_t status) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_send_flow_control_credit(tL2C_CCB* p_ccb, uint16_t credit_value) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_update_data_length(tL2C_LCB* p_lcb) {
-  mock_function_count_map[__func__]++;
-}
-void l2cble_use_preferred_conn_params(const RawAddress& bda) {
-  mock_function_count_map[__func__]++;
-}
diff --git a/bta/test/common/mock_stack_sdp.cc b/bta/test/common/mock_stack_sdp.cc
deleted file mode 100644 (file)
index 22252e8..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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
- */
-
-#include <string.h>
-
-#include "bt_target.h"
-
-#include "sdp_api.h"
-
-#include "osi/include/osi.h"
-
-using bluetooth::Uuid;
-
-bool SDP_InitDiscoveryDb(tSDP_DISCOVERY_DB* p_db, uint32_t len,
-                         uint16_t num_uuid, const Uuid* p_uuid_list,
-                         uint16_t num_attr, uint16_t* p_attr_list) {
-  return false;
-}
-
-bool SDP_CancelServiceSearch(tSDP_DISCOVERY_DB* p_db) { return false; }
-
-bool SDP_ServiceSearchRequest(const RawAddress& p_bd_addr,
-                              tSDP_DISCOVERY_DB* p_db,
-                              tSDP_DISC_CMPL_CB* p_cb) {
-  return false;
-}
-
-bool SDP_ServiceSearchAttributeRequest(const RawAddress& p_bd_addr,
-                                       tSDP_DISCOVERY_DB* p_db,
-                                       tSDP_DISC_CMPL_CB* p_cb) {
-  return false;
-}
-bool SDP_ServiceSearchAttributeRequest2(const RawAddress& p_bd_addr,
-                                        tSDP_DISCOVERY_DB* p_db,
-                                        tSDP_DISC_CMPL_CB2* p_cb2,
-                                        void* user_data) {
-  return false;
-}
-
-tSDP_DISC_ATTR* SDP_FindAttributeInRec(tSDP_DISC_REC* p_rec, uint16_t attr_id) {
-  return (NULL);
-}
-
-bool SDP_FindServiceUUIDInRec(tSDP_DISC_REC* p_rec, Uuid* p_uuid) {
-  return false;
-}
-
-bool SDP_FindServiceUUIDInRec_128bit(tSDP_DISC_REC* p_rec, Uuid* p_uuid) {
-  return false;
-}
-
-tSDP_DISC_REC* SDP_FindServiceInDb(tSDP_DISCOVERY_DB* p_db,
-                                   uint16_t service_uuid,
-                                   tSDP_DISC_REC* p_start_rec) {
-  return (NULL);
-}
-
-tSDP_DISC_REC* SDP_FindServiceInDb_128bit(tSDP_DISCOVERY_DB* p_db,
-                                          tSDP_DISC_REC* p_start_rec) {
-  return (NULL);
-}
-
-tSDP_DISC_REC* SDP_FindServiceUUIDInDb(tSDP_DISCOVERY_DB* p_db,
-                                       const Uuid& uuid,
-                                       tSDP_DISC_REC* p_start_rec) {
-  return (NULL);
-}
-
-bool SDP_FindProtocolListElemInRec(tSDP_DISC_REC* p_rec, uint16_t layer_uuid,
-                                   tSDP_PROTOCOL_ELEM* p_elem) {
-  return (false);
-}
-
-bool SDP_FindProfileVersionInRec(tSDP_DISC_REC* p_rec, uint16_t profile_uuid,
-                                 uint16_t* p_version) {
-  return (false);
-}
-
-tSDP_STATUS SDP_DiDiscover(const RawAddress& remote_device,
-                           tSDP_DISCOVERY_DB* p_db, uint32_t len,
-                           tSDP_DISC_CMPL_CB* p_cb) {
-  return SDP_SUCCESS;
-}
-
-uint8_t SDP_GetNumDiRecords(tSDP_DISCOVERY_DB* p_db) { return 0; }
-
-uint16_t SDP_GetDiRecord(uint8_t get_record_index,
-                         tSDP_DI_GET_RECORD* p_device_info,
-                         tSDP_DISCOVERY_DB* p_db) {
-  return 0;
-}
-uint16_t SDP_SetLocalDiRecord(tSDP_DI_RECORD* p_device_info,
-                              uint32_t* p_handle) {
-  return 0;
-}
-uint8_t SDP_SetTraceLevel(uint8_t new_level) { return 0; }
index 0e75796..9fc7f75 100644 (file)
@@ -137,3 +137,17 @@ filegroup {
       "stub/legacy_trace.cc",
   ],
 }
+
+filegroup {
+  name: "TestStubOsi",
+  srcs: [
+      "stub/osi.cc",
+  ],
+}
+
+filegroup {
+  name: "TestMockStackAcl",
+  srcs: [
+      "mock/mock_stack_acl*.cc",
+  ],
+}
index 594d2ca..b4dc16d 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 // #include "gd/btaa/activity_attribution.h"
+#include "gd/module.h"
+
 #include "gd/hci/acl_manager_mock.h"
 #include "gd/hci/controller_mock.h"
 #include "gd/hci/hci_layer.h"
@@ -30,7 +32,6 @@
 #include "gd/security/security_module.h"
 #include "gd/shim/dumpsys.h"
 #include "gd/storage/storage_module.h"
-#include "hci/acl_manager.h"
 #include "main/shim/entry.h"
 #include "main/shim/stack.h"
 
index 1b2305a..2461c37 100644 (file)
@@ -56,6 +56,11 @@ tBTM_CONTRL_STATE BTM_PM_ReadControllerState(void) {
   mock_function_count_map[__func__]++;
   return 0;
 }
+tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id,
+                           tBTM_PM_STATUS_CBACK* p_cb) {
+  mock_function_count_map[__func__]++;
+  return BTM_SUCCESS;
+}
 tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
                              const tBTM_PM_PWR_MD* p_mode) {
   mock_function_count_map[__func__]++;
similarity index 100%
rename from bta/test/common/fake_osi.cc
rename to test/stub/osi.cc