summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Manton <cmanton@google.com> 2021-07-07 13:45:56 -0700
committer Chris Manton <cmanton@google.com> 2021-07-16 05:05:59 +0000
commit8f47f483c180bc900517e467e06b9c4826c021cb (patch)
treefce6797ca589f94000a8b1f05984138f72daf52d
parent04ce740f1ced9e4bfc3e37fc9f2afad1f07adaa4 (diff)
legacy: update select mocks to v3.0
Bug: 187825293 Tag: #refactor Test: gd/cert/run Change-Id: Iff97cac25252bb4c928319d753af7b82cf6b8ce6
-rw-r--r--system/test/common/mock_functions.cc35
-rw-r--r--system/test/common/mock_functions.h22
-rw-r--r--system/test/mock/mock_bta_dm_api.cc170
-rw-r--r--system/test/mock/mock_bta_dm_api.h488
-rw-r--r--system/test/mock/mock_bta_hh_utils.cc110
-rw-r--r--system/test/mock/mock_bta_hh_utils.h190
-rw-r--r--system/test/mock/mock_bta_sys_main.cc78
-rw-r--r--system/test/mock/mock_bta_sys_main.h166
-rw-r--r--system/test/mock/mock_btcore_module.cc70
-rw-r--r--system/test/mock/mock_btcore_module.h133
-rw-r--r--system/test/mock/mock_device_esco_parameters.cc53
-rw-r--r--system/test/mock/mock_device_esco_parameters.h63
-rw-r--r--system/test/mock/mock_utils_bt.cc62
-rw-r--r--system/test/mock/mock_utils_bt.h75
14 files changed, 1633 insertions, 82 deletions
diff --git a/system/test/common/mock_functions.cc b/system/test/common/mock_functions.cc
new file mode 100644
index 0000000000..20462b81cd
--- /dev/null
+++ b/system/test/common/mock_functions.cc
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <map>
+
+#include "osi/include/log.h"
+#include "test/common/mock_functions.h"
+
+// tLEGACY_TRACE_LEVEL
+// uint8_t btu_trace_level = 6;
+uint8_t appl_trace_level = 6;
+uint8_t btif_trace_level = 6;
+
+std::map<std::string, int> mock_function_count_map;
+
+void dump_mock_function_count_map() {
+ LOG_INFO("Mock function count map size:%zu", mock_function_count_map.size());
+
+ for (auto it : mock_function_count_map) {
+ LOG_INFO("function:%s: call_count:%d", it.first.c_str(), it.second);
+ }
+}
diff --git a/system/test/common/mock_functions.h b/system/test/common/mock_functions.h
new file mode 100644
index 0000000000..8889b86098
--- /dev/null
+++ b/system/test/common/mock_functions.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <map>
+
+extern std::map<std::string, int> mock_function_count_map;
+void dump_mock_function_count_map();
diff --git a/system/test/mock/mock_bta_dm_api.cc b/system/test/mock/mock_bta_dm_api.cc
index 3a7d3ca94a..d7fb22ed20 100644
--- a/system/test/mock/mock_bta_dm_api.cc
+++ b/system/test/mock/mock_bta_dm_api.cc
@@ -16,136 +16,232 @@
/*
* Generated mock file from original source file
- * Functions generated:33
+ * Functions generated:34
+ *
+ * mockcify.pl ver 0.3.0
*/
+#include <cstdint>
+#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
-#include <base/bind.h>
-#include <vector>
-#include "bt_target.h"
-#include "bta/dm/bta_dm_int.h"
-#include "osi/include/allocator.h"
-#include "stack/btm/btm_sec.h"
-#include "stack/include/btm_api.h"
-#include "stack/include/btu.h"
-#include "types/bluetooth/uuid.h"
-#include "types/raw_address.h"
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_bta_dm_api.h"
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
+// Mocked internal structures, if any
-void BTA_dm_init() { mock_function_count_map[__func__]++; }
-bool BTA_DmGetConnectionState(const RawAddress& bd_addr) {
- mock_function_count_map[__func__]++;
- return false;
-}
-tBTA_STATUS BTA_DmRemoveDevice(const RawAddress& bd_addr) {
- mock_function_count_map[__func__]++;
- return BTA_SUCCESS;
-}
-tBTA_STATUS BTA_DmSetLocalDiRecord(tSDP_DI_RECORD* p_device_info,
- uint32_t* p_handle) {
+namespace test {
+namespace mock {
+namespace bta_dm_api {
+
+// Function state capture and return values, if needed
+struct BTA_AddEirUuid BTA_AddEirUuid;
+struct BTA_DmAddBleDevice BTA_DmAddBleDevice;
+struct BTA_DmAddBleKey BTA_DmAddBleKey;
+struct BTA_DmAddDevice BTA_DmAddDevice;
+struct BTA_DmBleConfigLocalPrivacy BTA_DmBleConfigLocalPrivacy;
+struct BTA_DmBleConfirmReply BTA_DmBleConfirmReply;
+struct BTA_DmBleCsisObserve BTA_DmBleCsisObserve;
+struct BTA_DmBleGetEnergyInfo BTA_DmBleGetEnergyInfo;
+struct BTA_DmBleObserve BTA_DmBleObserve;
+struct BTA_DmBlePasskeyReply BTA_DmBlePasskeyReply;
+struct BTA_DmBleRequestMaxTxDataLength BTA_DmBleRequestMaxTxDataLength;
+struct BTA_DmBleScan BTA_DmBleScan;
+struct BTA_DmBleSecurityGrant BTA_DmBleSecurityGrant;
+struct BTA_DmBleUpdateConnectionParams BTA_DmBleUpdateConnectionParams;
+struct BTA_DmBond BTA_DmBond;
+struct BTA_DmBondCancel BTA_DmBondCancel;
+struct BTA_DmCloseACL BTA_DmCloseACL;
+struct BTA_DmConfirm BTA_DmConfirm;
+struct BTA_DmDiscover BTA_DmDiscover;
+struct BTA_DmGetConnectionState BTA_DmGetConnectionState;
+struct BTA_DmLocalOob BTA_DmLocalOob;
+struct BTA_DmPinReply BTA_DmPinReply;
+struct BTA_DmRemoveDevice BTA_DmRemoveDevice;
+struct BTA_DmSearch BTA_DmSearch;
+struct BTA_DmSearchCancel BTA_DmSearchCancel;
+struct BTA_DmSetBlePrefConnParams BTA_DmSetBlePrefConnParams;
+struct BTA_DmSetDeviceName BTA_DmSetDeviceName;
+struct BTA_DmSetEncryption BTA_DmSetEncryption;
+struct BTA_DmSetLocalDiRecord BTA_DmSetLocalDiRecord;
+struct BTA_EnableTestMode BTA_EnableTestMode;
+struct BTA_GetEirService BTA_GetEirService;
+struct BTA_RemoveEirUuid BTA_RemoveEirUuid;
+struct BTA_VendorInit BTA_VendorInit;
+struct BTA_dm_init BTA_dm_init;
+
+} // namespace bta_dm_api
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void BTA_AddEirUuid(uint16_t uuid16) {
mock_function_count_map[__func__]++;
- return BTA_SUCCESS;
+ test::mock::bta_dm_api::BTA_AddEirUuid(uuid16);
}
-void BTA_AddEirUuid(uint16_t uuid16) { mock_function_count_map[__func__]++; }
void BTA_DmAddBleDevice(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
tBT_DEVICE_TYPE dev_type) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmAddBleDevice(bd_addr, addr_type, dev_type);
}
void BTA_DmAddBleKey(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
tBTM_LE_KEY_TYPE key_type) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmAddBleKey(bd_addr, p_le_key, key_type);
}
void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
const LinkKey& link_key, uint8_t key_type,
uint8_t pin_length) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmAddDevice(bd_addr, dev_class, link_key,
+ key_type, pin_length);
}
void BTA_DmBleConfigLocalPrivacy(bool privacy_enable) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleConfigLocalPrivacy(privacy_enable);
}
void BTA_DmBleConfirmReply(const RawAddress& bd_addr, bool accept) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleConfirmReply(bd_addr, accept);
+}
+void BTA_DmBleCsisObserve(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleCsisObserve(observe, p_results_cb);
}
void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleGetEnergyInfo(p_cmpl_cback);
+}
+void BTA_DmBleObserve(bool start, uint8_t duration,
+ tBTA_DM_SEARCH_CBACK* p_results_cb) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleObserve(start, duration, p_results_cb);
}
void BTA_DmBlePasskeyReply(const RawAddress& bd_addr, bool accept,
uint32_t passkey) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBlePasskeyReply(bd_addr, accept, passkey);
}
void BTA_DmBleRequestMaxTxDataLength(const RawAddress& remote_device) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleRequestMaxTxDataLength(remote_device);
+}
+void BTA_DmBleScan(bool start, uint8_t duration) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleScan(start, duration);
}
void BTA_DmBleSecurityGrant(const RawAddress& bd_addr,
tBTA_DM_BLE_SEC_GRANT res) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBleSecurityGrant(bd_addr, res);
}
void BTA_DmBleUpdateConnectionParams(const RawAddress& bd_addr,
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__]++;
+ test::mock::bta_dm_api::BTA_DmBleUpdateConnectionParams(
+ bd_addr, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
}
void BTA_DmBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBond(bd_addr, addr_type, transport,
+ device_type);
}
void BTA_DmBondCancel(const RawAddress& bd_addr) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmBondCancel(bd_addr);
}
void BTA_DmCloseACL(const RawAddress& bd_addr, bool remove_dev,
tBT_TRANSPORT transport) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmCloseACL(bd_addr, remove_dev, transport);
}
void BTA_DmConfirm(const RawAddress& bd_addr, bool accept) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmConfirm(bd_addr, accept);
}
void BTA_DmDiscover(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
tBT_TRANSPORT transport, bool is_bonding_or_sd) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmDiscover(bd_addr, p_cback, transport,
+ is_bonding_or_sd);
+}
+bool BTA_DmGetConnectionState(const RawAddress& bd_addr) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_dm_api::BTA_DmGetConnectionState(bd_addr);
+}
+void BTA_DmLocalOob(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmLocalOob();
}
-void BTA_DmLocalOob(void) { mock_function_count_map[__func__]++; }
void BTA_DmPinReply(const RawAddress& bd_addr, bool accept, uint8_t pin_len,
uint8_t* p_pin) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmPinReply(bd_addr, accept, pin_len, p_pin);
+}
+tBTA_STATUS BTA_DmRemoveDevice(const RawAddress& bd_addr) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_dm_api::BTA_DmRemoveDevice(bd_addr);
}
void BTA_DmSearch(tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmSearch(p_cback, is_bonding_or_sdp);
+}
+void BTA_DmSearchCancel(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmSearchCancel();
}
-void BTA_DmSearchCancel(void) { mock_function_count_map[__func__]++; }
void BTA_DmSetBlePrefConnParams(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__]++;
+ test::mock::bta_dm_api::BTA_DmSetBlePrefConnParams(
+ bd_addr, min_conn_int, max_conn_int, peripheral_latency,
+ supervision_tout);
+}
+void BTA_DmSetDeviceName(char* p_name) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmSetDeviceName(p_name);
}
-void BTA_DmSetDeviceName(char* p_name) { mock_function_count_map[__func__]++; }
void BTA_DmSetEncryption(const RawAddress& bd_addr, tBT_TRANSPORT transport,
tBTA_DM_ENCRYPT_CBACK* p_callback,
tBTM_BLE_SEC_ACT sec_act) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_DmSetEncryption(bd_addr, transport, p_callback,
+ sec_act);
+}
+tBTA_STATUS BTA_DmSetLocalDiRecord(tSDP_DI_RECORD* p_device_info,
+ uint32_t* p_handle) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_dm_api::BTA_DmSetLocalDiRecord(p_device_info,
+ p_handle);
+}
+void BTA_EnableTestMode(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_EnableTestMode();
}
-void BTA_EnableTestMode(void) { mock_function_count_map[__func__]++; }
void BTA_GetEirService(uint8_t* p_eir, size_t eir_len,
tBTA_SERVICE_MASK* p_services) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_GetEirService(p_eir, eir_len, p_services);
}
-void BTA_RemoveEirUuid(uint16_t uuid16) { mock_function_count_map[__func__]++; }
-void BTA_DmBleObserve(bool start, uint8_t duration,
- tBTA_DM_SEARCH_CBACK* p_results_cb) {
+void BTA_RemoveEirUuid(uint16_t uuid16) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_RemoveEirUuid(uuid16);
}
-void BTA_DmBleScan(bool start, uint8_t duration) {
+void BTA_VendorInit(void) {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_VendorInit();
}
-void BTA_DmBleCsisObserve(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {
+void BTA_dm_init() {
mock_function_count_map[__func__]++;
+ test::mock::bta_dm_api::BTA_dm_init();
}
-void BTA_VendorInit(void) { mock_function_count_map[__func__]++; }
+
+// END mockcify generation
diff --git a/system/test/mock/mock_bta_dm_api.h b/system/test/mock/mock_bta_dm_api.h
new file mode 100644
index 0000000000..324b9ec94d
--- /dev/null
+++ b/system/test/mock/mock_bta_dm_api.h
@@ -0,0 +1,488 @@
+/*
+ * 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:34
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include <base/bind.h>
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "bt_target.h"
+#include "bta/dm/bta_dm_int.h"
+#include "osi/include/allocator.h"
+#include "stack/btm/btm_sec.h"
+#include "stack/include/btm_api.h"
+#include "stack/include/btu.h"
+#include "types/bluetooth/uuid.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace bta_dm_api {
+
+// Shared state between mocked functions and tests
+// Name: BTA_AddEirUuid
+// Params: uint16_t uuid16
+// Return: void
+struct BTA_AddEirUuid {
+ std::function<void(uint16_t uuid16)> body{[](uint16_t uuid16) {}};
+ void operator()(uint16_t uuid16) { body(uuid16); };
+};
+extern struct BTA_AddEirUuid BTA_AddEirUuid;
+
+// Name: BTA_DmAddBleDevice
+// Params: const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_DEVICE_TYPE
+// dev_type Return: void
+struct BTA_DmAddBleDevice {
+ std::function<void(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_DEVICE_TYPE dev_type)>
+ body{[](const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_DEVICE_TYPE dev_type) {}};
+ void operator()(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_DEVICE_TYPE dev_type) {
+ body(bd_addr, addr_type, dev_type);
+ };
+};
+extern struct BTA_DmAddBleDevice BTA_DmAddBleDevice;
+
+// Name: BTA_DmAddBleKey
+// Params: const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
+// tBTM_LE_KEY_TYPE key_type Return: void
+struct BTA_DmAddBleKey {
+ std::function<void(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
+ tBTM_LE_KEY_TYPE key_type)>
+ body{[](const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
+ tBTM_LE_KEY_TYPE key_type) {}};
+ void operator()(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
+ tBTM_LE_KEY_TYPE key_type) {
+ body(bd_addr, p_le_key, key_type);
+ };
+};
+extern struct BTA_DmAddBleKey BTA_DmAddBleKey;
+
+// Name: BTA_DmAddDevice
+// Params: const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey&
+// link_key, uint8_t key_type, uint8_t pin_length Return: void
+struct BTA_DmAddDevice {
+ std::function<void(const RawAddress& bd_addr, DEV_CLASS dev_class,
+ const LinkKey& link_key, uint8_t key_type,
+ uint8_t pin_length)>
+ body{[](const RawAddress& bd_addr, DEV_CLASS dev_class,
+ const LinkKey& link_key, uint8_t key_type,
+ uint8_t pin_length) {}};
+ void operator()(const RawAddress& bd_addr, DEV_CLASS dev_class,
+ const LinkKey& link_key, uint8_t key_type,
+ uint8_t pin_length) {
+ body(bd_addr, dev_class, link_key, key_type, pin_length);
+ };
+};
+extern struct BTA_DmAddDevice BTA_DmAddDevice;
+
+// Name: BTA_DmBleConfigLocalPrivacy
+// Params: bool privacy_enable
+// Return: void
+struct BTA_DmBleConfigLocalPrivacy {
+ std::function<void(bool privacy_enable)> body{[](bool privacy_enable) {}};
+ void operator()(bool privacy_enable) { body(privacy_enable); };
+};
+extern struct BTA_DmBleConfigLocalPrivacy BTA_DmBleConfigLocalPrivacy;
+
+// Name: BTA_DmBleConfirmReply
+// Params: const RawAddress& bd_addr, bool accept
+// Return: void
+struct BTA_DmBleConfirmReply {
+ std::function<void(const RawAddress& bd_addr, bool accept)> body{
+ [](const RawAddress& bd_addr, bool accept) {}};
+ void operator()(const RawAddress& bd_addr, bool accept) {
+ body(bd_addr, accept);
+ };
+};
+extern struct BTA_DmBleConfirmReply BTA_DmBleConfirmReply;
+
+// Name: BTA_DmBleCsisObserve
+// Params: bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb
+// Return: void
+struct BTA_DmBleCsisObserve {
+ std::function<void(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb)> body{
+ [](bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {}};
+ void operator()(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {
+ body(observe, p_results_cb);
+ };
+};
+extern struct BTA_DmBleCsisObserve BTA_DmBleCsisObserve;
+
+// Name: BTA_DmBleGetEnergyInfo
+// Params: tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback
+// Return: void
+struct BTA_DmBleGetEnergyInfo {
+ std::function<void(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback)> body{
+ [](tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {}};
+ void operator()(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {
+ body(p_cmpl_cback);
+ };
+};
+extern struct BTA_DmBleGetEnergyInfo BTA_DmBleGetEnergyInfo;
+
+// Name: BTA_DmBleObserve
+// Params: bool start, uint8_t duration, tBTA_DM_SEARCH_CBACK* p_results_cb
+// Return: void
+struct BTA_DmBleObserve {
+ std::function<void(bool start, uint8_t duration,
+ tBTA_DM_SEARCH_CBACK* p_results_cb)>
+ body{[](bool start, uint8_t duration,
+ tBTA_DM_SEARCH_CBACK* p_results_cb) {}};
+ void operator()(bool start, uint8_t duration,
+ tBTA_DM_SEARCH_CBACK* p_results_cb) {
+ body(start, duration, p_results_cb);
+ };
+};
+extern struct BTA_DmBleObserve BTA_DmBleObserve;
+
+// Name: BTA_DmBlePasskeyReply
+// Params: const RawAddress& bd_addr, bool accept, uint32_t passkey
+// Return: void
+struct BTA_DmBlePasskeyReply {
+ std::function<void(const RawAddress& bd_addr, bool accept, uint32_t passkey)>
+ body{[](const RawAddress& bd_addr, bool accept, uint32_t passkey) {}};
+ void operator()(const RawAddress& bd_addr, bool accept, uint32_t passkey) {
+ body(bd_addr, accept, passkey);
+ };
+};
+extern struct BTA_DmBlePasskeyReply BTA_DmBlePasskeyReply;
+
+// Name: BTA_DmBleRequestMaxTxDataLength
+// Params: const RawAddress& remote_device
+// Return: void
+struct BTA_DmBleRequestMaxTxDataLength {
+ std::function<void(const RawAddress& remote_device)> body{
+ [](const RawAddress& remote_device) {}};
+ void operator()(const RawAddress& remote_device) { body(remote_device); };
+};
+extern struct BTA_DmBleRequestMaxTxDataLength BTA_DmBleRequestMaxTxDataLength;
+
+// Name: BTA_DmBleScan
+// Params: bool start, uint8_t duration
+// Return: void
+struct BTA_DmBleScan {
+ std::function<void(bool start, uint8_t duration)> body{
+ [](bool start, uint8_t duration) {}};
+ void operator()(bool start, uint8_t duration) { body(start, duration); };
+};
+extern struct BTA_DmBleScan BTA_DmBleScan;
+
+// Name: BTA_DmBleSecurityGrant
+// Params: const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res
+// Return: void
+struct BTA_DmBleSecurityGrant {
+ std::function<void(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res)>
+ body{[](const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) {}};
+ void operator()(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) {
+ body(bd_addr, res);
+ };
+};
+extern struct BTA_DmBleSecurityGrant BTA_DmBleSecurityGrant;
+
+// Name: BTA_DmBleUpdateConnectionParams
+// Params: const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
+// uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len
+// Return: void
+struct BTA_DmBleUpdateConnectionParams {
+ std::function<void(const RawAddress& bd_addr, uint16_t min_int,
+ uint16_t max_int, uint16_t latency, uint16_t timeout,
+ uint16_t min_ce_len, uint16_t max_ce_len)>
+ body{[](const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
+ uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
+ uint16_t max_ce_len) {}};
+ void operator()(const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
+ uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
+ uint16_t max_ce_len) {
+ body(bd_addr, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
+ };
+};
+extern struct BTA_DmBleUpdateConnectionParams BTA_DmBleUpdateConnectionParams;
+
+// Name: BTA_DmBond
+// Params: const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSPORT
+// transport, tBT_DEVICE_TYPE device_type Return: void
+struct BTA_DmBond {
+ std::function<void(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type)>
+ body{[](const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {}};
+ void operator()(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {
+ body(bd_addr, addr_type, transport, device_type);
+ };
+};
+extern struct BTA_DmBond BTA_DmBond;
+
+// Name: BTA_DmBondCancel
+// Params: const RawAddress& bd_addr
+// Return: void
+struct BTA_DmBondCancel {
+ std::function<void(const RawAddress& bd_addr)> body{
+ [](const RawAddress& bd_addr) {}};
+ void operator()(const RawAddress& bd_addr) { body(bd_addr); };
+};
+extern struct BTA_DmBondCancel BTA_DmBondCancel;
+
+// Name: BTA_DmCloseACL
+// Params: const RawAddress& bd_addr, bool remove_dev, tBT_TRANSPORT transport
+// Return: void
+struct BTA_DmCloseACL {
+ std::function<void(const RawAddress& bd_addr, bool remove_dev,
+ tBT_TRANSPORT transport)>
+ body{[](const RawAddress& bd_addr, bool remove_dev,
+ tBT_TRANSPORT transport) {}};
+ void operator()(const RawAddress& bd_addr, bool remove_dev,
+ tBT_TRANSPORT transport) {
+ body(bd_addr, remove_dev, transport);
+ };
+};
+extern struct BTA_DmCloseACL BTA_DmCloseACL;
+
+// Name: BTA_DmConfirm
+// Params: const RawAddress& bd_addr, bool accept
+// Return: void
+struct BTA_DmConfirm {
+ std::function<void(const RawAddress& bd_addr, bool accept)> body{
+ [](const RawAddress& bd_addr, bool accept) {}};
+ void operator()(const RawAddress& bd_addr, bool accept) {
+ body(bd_addr, accept);
+ };
+};
+extern struct BTA_DmConfirm BTA_DmConfirm;
+
+// Name: BTA_DmDiscover
+// Params: const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
+// tBT_TRANSPORT transport, bool is_bonding_or_sd Return: void
+struct BTA_DmDiscover {
+ std::function<void(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
+ tBT_TRANSPORT transport, bool is_bonding_or_sd)>
+ body{[](const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
+ tBT_TRANSPORT transport, bool is_bonding_or_sd) {}};
+ void operator()(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
+ tBT_TRANSPORT transport, bool is_bonding_or_sd) {
+ body(bd_addr, p_cback, transport, is_bonding_or_sd);
+ };
+};
+extern struct BTA_DmDiscover BTA_DmDiscover;
+
+// Name: BTA_DmGetConnectionState
+// Params: const RawAddress& bd_addr
+// Return: bool
+struct BTA_DmGetConnectionState {
+ bool return_value{false};
+ std::function<bool(const RawAddress& bd_addr)> body{
+ [this](const RawAddress& bd_addr) { return return_value; }};
+ bool operator()(const RawAddress& bd_addr) { return body(bd_addr); };
+};
+extern struct BTA_DmGetConnectionState BTA_DmGetConnectionState;
+
+// Name: BTA_DmLocalOob
+// Params: void
+// Return: void
+struct BTA_DmLocalOob {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct BTA_DmLocalOob BTA_DmLocalOob;
+
+// Name: BTA_DmPinReply
+// Params: const RawAddress& bd_addr, bool accept, uint8_t pin_len, uint8_t*
+// p_pin Return: void
+struct BTA_DmPinReply {
+ std::function<void(const RawAddress& bd_addr, bool accept, uint8_t pin_len,
+ uint8_t* p_pin)>
+ body{[](const RawAddress& bd_addr, bool accept, uint8_t pin_len,
+ uint8_t* p_pin) {}};
+ void operator()(const RawAddress& bd_addr, bool accept, uint8_t pin_len,
+ uint8_t* p_pin) {
+ body(bd_addr, accept, pin_len, p_pin);
+ };
+};
+extern struct BTA_DmPinReply BTA_DmPinReply;
+
+// Name: BTA_DmRemoveDevice
+// Params: const RawAddress& bd_addr
+// Return: tBTA_STATUS
+struct BTA_DmRemoveDevice {
+ tBTA_STATUS return_value{0};
+ std::function<tBTA_STATUS(const RawAddress& bd_addr)> body{
+ [this](const RawAddress& bd_addr) { return return_value; }};
+ tBTA_STATUS operator()(const RawAddress& bd_addr) { return body(bd_addr); };
+};
+extern struct BTA_DmRemoveDevice BTA_DmRemoveDevice;
+
+// Name: BTA_DmSearch
+// Params: tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp
+// Return: void
+struct BTA_DmSearch {
+ std::function<void(tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp)>
+ body{[](tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp) {}};
+ void operator()(tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp) {
+ body(p_cback, is_bonding_or_sdp);
+ };
+};
+extern struct BTA_DmSearch BTA_DmSearch;
+
+// Name: BTA_DmSearchCancel
+// Params: void
+// Return: void
+struct BTA_DmSearchCancel {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct BTA_DmSearchCancel BTA_DmSearchCancel;
+
+// Name: BTA_DmSetBlePrefConnParams
+// Params: const RawAddress& bd_addr, uint16_t min_conn_int, uint16_t
+// max_conn_int, uint16_t peripheral_latency, uint16_t supervision_tout Return:
+// void
+struct BTA_DmSetBlePrefConnParams {
+ std::function<void(const RawAddress& bd_addr, uint16_t min_conn_int,
+ uint16_t max_conn_int, uint16_t peripheral_latency,
+ uint16_t supervision_tout)>
+ body{[](const RawAddress& bd_addr, uint16_t min_conn_int,
+ uint16_t max_conn_int, uint16_t peripheral_latency,
+ uint16_t supervision_tout) {}};
+ void operator()(const RawAddress& bd_addr, uint16_t min_conn_int,
+ uint16_t max_conn_int, uint16_t peripheral_latency,
+ uint16_t supervision_tout) {
+ body(bd_addr, min_conn_int, max_conn_int, peripheral_latency,
+ supervision_tout);
+ };
+};
+extern struct BTA_DmSetBlePrefConnParams BTA_DmSetBlePrefConnParams;
+
+// Name: BTA_DmSetDeviceName
+// Params: char* p_name
+// Return: void
+struct BTA_DmSetDeviceName {
+ std::function<void(char* p_name)> body{[](char* p_name) {}};
+ void operator()(char* p_name) { body(p_name); };
+};
+extern struct BTA_DmSetDeviceName BTA_DmSetDeviceName;
+
+// Name: BTA_DmSetEncryption
+// Params: const RawAddress& bd_addr, tBT_TRANSPORT transport,
+// tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act Return: void
+struct BTA_DmSetEncryption {
+ std::function<void(const RawAddress& bd_addr, tBT_TRANSPORT transport,
+ tBTA_DM_ENCRYPT_CBACK* p_callback,
+ tBTM_BLE_SEC_ACT sec_act)>
+ body{[](const RawAddress& bd_addr, tBT_TRANSPORT transport,
+ tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act) {}};
+ void operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport,
+ tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act) {
+ body(bd_addr, transport, p_callback, sec_act);
+ };
+};
+extern struct BTA_DmSetEncryption BTA_DmSetEncryption;
+
+// Name: BTA_DmSetLocalDiRecord
+// Params: tSDP_DI_RECORD* p_device_info, uint32_t* p_handle
+// Return: tBTA_STATUS
+struct BTA_DmSetLocalDiRecord {
+ tBTA_STATUS return_value{0};
+ std::function<tBTA_STATUS(tSDP_DI_RECORD* p_device_info, uint32_t* p_handle)>
+ body{[this](tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) {
+ return return_value;
+ }};
+ tBTA_STATUS operator()(tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) {
+ return body(p_device_info, p_handle);
+ };
+};
+extern struct BTA_DmSetLocalDiRecord BTA_DmSetLocalDiRecord;
+
+// Name: BTA_EnableTestMode
+// Params: void
+// Return: void
+struct BTA_EnableTestMode {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct BTA_EnableTestMode BTA_EnableTestMode;
+
+// Name: BTA_GetEirService
+// Params: uint8_t* p_eir, size_t eir_len, tBTA_SERVICE_MASK* p_services
+// Return: void
+struct BTA_GetEirService {
+ std::function<void(uint8_t* p_eir, size_t eir_len,
+ tBTA_SERVICE_MASK* p_services)>
+ body{
+ [](uint8_t* p_eir, size_t eir_len, tBTA_SERVICE_MASK* p_services) {}};
+ void operator()(uint8_t* p_eir, size_t eir_len,
+ tBTA_SERVICE_MASK* p_services) {
+ body(p_eir, eir_len, p_services);
+ };
+};
+extern struct BTA_GetEirService BTA_GetEirService;
+
+// Name: BTA_RemoveEirUuid
+// Params: uint16_t uuid16
+// Return: void
+struct BTA_RemoveEirUuid {
+ std::function<void(uint16_t uuid16)> body{[](uint16_t uuid16) {}};
+ void operator()(uint16_t uuid16) { body(uuid16); };
+};
+extern struct BTA_RemoveEirUuid BTA_RemoveEirUuid;
+
+// Name: BTA_VendorInit
+// Params: void
+// Return: void
+struct BTA_VendorInit {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct BTA_VendorInit BTA_VendorInit;
+
+// Name: BTA_dm_init
+// Params:
+// Return: void
+struct BTA_dm_init {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct BTA_dm_init BTA_dm_init;
+
+} // namespace bta_dm_api
+} // namespace mock
+} // namespace test
+
+// END mockcify generation \ No newline at end of file
diff --git a/system/test/mock/mock_bta_hh_utils.cc b/system/test/mock/mock_bta_hh_utils.cc
new file mode 100644
index 0000000000..2f77f71efa
--- /dev/null
+++ b/system/test/mock/mock_bta_hh_utils.cc
@@ -0,0 +1,110 @@
+/*
+ * 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:10
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_bta_hh_utils.h"
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace bta_hh_utils {
+
+// Function state capture and return values, if needed
+struct bta_hh_add_device_to_list bta_hh_add_device_to_list;
+struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev;
+struct bta_hh_cleanup_disable bta_hh_cleanup_disable;
+struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx;
+struct bta_hh_find_cb bta_hh_find_cb;
+struct bta_hh_get_cb bta_hh_get_cb;
+struct bta_hh_read_ssr_param bta_hh_read_ssr_param;
+struct bta_hh_tod_spt bta_hh_tod_spt;
+struct bta_hh_trace_dev_db bta_hh_trace_dev_db;
+struct bta_hh_update_di_info bta_hh_update_di_info;
+
+} // namespace bta_hh_utils
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void bta_hh_add_device_to_list(tBTA_HH_DEV_CB* p_cb, uint8_t handle,
+ uint16_t attr_mask,
+ const tHID_DEV_DSCP_INFO* p_dscp_info,
+ uint8_t sub_class, uint16_t ssr_max_latency,
+ uint16_t ssr_min_tout, uint8_t app_id) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_hh_utils::bta_hh_add_device_to_list(
+ p_cb, handle, attr_mask, p_dscp_info, sub_class, ssr_max_latency,
+ ssr_min_tout, app_id);
+}
+void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB* p_cb) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_hh_utils::bta_hh_clean_up_kdev(p_cb);
+}
+void bta_hh_cleanup_disable(tBTA_HH_STATUS status) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_hh_utils::bta_hh_cleanup_disable(status);
+}
+uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_hh_utils::bta_hh_dev_handle_to_cb_idx(dev_handle);
+}
+uint8_t bta_hh_find_cb(const RawAddress& bda) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_hh_utils::bta_hh_find_cb(bda);
+}
+tBTA_HH_DEV_CB* bta_hh_get_cb(const RawAddress& bda) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_hh_utils::bta_hh_get_cb(bda);
+}
+tBTA_HH_STATUS bta_hh_read_ssr_param(const RawAddress& bd_addr,
+ uint16_t* p_max_ssr_lat,
+ uint16_t* p_min_ssr_tout) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_hh_utils::bta_hh_read_ssr_param(bd_addr, p_max_ssr_lat,
+ p_min_ssr_tout);
+}
+bool bta_hh_tod_spt(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_hh_utils::bta_hh_tod_spt(p_cb, sub_class);
+}
+void bta_hh_trace_dev_db(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_hh_utils::bta_hh_trace_dev_db();
+}
+void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
+ uint16_t product_id, uint16_t version,
+ uint8_t flag) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_hh_utils::bta_hh_update_di_info(p_cb, vendor_id, product_id,
+ version, flag);
+}
+// Mocked functions complete
+// END mockcify generation
diff --git a/system/test/mock/mock_bta_hh_utils.h b/system/test/mock/mock_bta_hh_utils.h
new file mode 100644
index 0000000000..7407a809cc
--- /dev/null
+++ b/system/test/mock/mock_bta_hh_utils.h
@@ -0,0 +1,190 @@
+/*
+ * 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:10
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include <string.h>
+
+#include <cstring>
+
+#include "bt_target.h"
+#include "bt_trace.h"
+#include "bta/hh/bta_hh_int.h"
+#include "btif/include/btif_storage.h"
+#include "device/include/interop.h"
+#include "osi/include/osi.h"
+#include "stack/include/acl_api.h"
+#include "stack/include/btm_client_interface.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace bta_hh_utils {
+
+// Shared state between mocked functions and tests
+// Name: bta_hh_add_device_to_list
+// Params: tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, const
+// tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, uint16_t ssr_max_latency,
+// uint16_t ssr_min_tout, uint8_t app_id Return: void
+struct bta_hh_add_device_to_list {
+ std::function<void(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
+ const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
+ uint16_t ssr_max_latency, uint16_t ssr_min_tout,
+ uint8_t app_id)>
+ body{[](tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
+ const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
+ uint16_t ssr_max_latency, uint16_t ssr_min_tout,
+ uint8_t app_id) {}};
+ void operator()(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
+ const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
+ uint16_t ssr_max_latency, uint16_t ssr_min_tout,
+ uint8_t app_id) {
+ body(p_cb, handle, attr_mask, p_dscp_info, sub_class, ssr_max_latency,
+ ssr_min_tout, app_id);
+ };
+};
+extern struct bta_hh_add_device_to_list bta_hh_add_device_to_list;
+
+// Name: bta_hh_clean_up_kdev
+// Params: tBTA_HH_DEV_CB* p_cb
+// Return: void
+struct bta_hh_clean_up_kdev {
+ std::function<void(tBTA_HH_DEV_CB* p_cb)> body{[](tBTA_HH_DEV_CB* p_cb) {}};
+ void operator()(tBTA_HH_DEV_CB* p_cb) { body(p_cb); };
+};
+extern struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev;
+
+// Name: bta_hh_cleanup_disable
+// Params: tBTA_HH_STATUS status
+// Return: void
+struct bta_hh_cleanup_disable {
+ std::function<void(tBTA_HH_STATUS status)> body{[](tBTA_HH_STATUS status) {}};
+ void operator()(tBTA_HH_STATUS status) { body(status); };
+};
+extern struct bta_hh_cleanup_disable bta_hh_cleanup_disable;
+
+// Name: bta_hh_dev_handle_to_cb_idx
+// Params: uint8_t dev_handle
+// Return: uint8_t
+struct bta_hh_dev_handle_to_cb_idx {
+ uint8_t return_value{0};
+ std::function<uint8_t(uint8_t dev_handle)> body{
+ [this](uint8_t dev_handle) { return return_value; }};
+ uint8_t operator()(uint8_t dev_handle) { return body(dev_handle); };
+};
+extern struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx;
+
+// Name: bta_hh_find_cb
+// Params: const RawAddress& bda
+// Return: uint8_t
+struct bta_hh_find_cb {
+ uint8_t return_value{0};
+ std::function<uint8_t(const RawAddress& bda)> body{
+ [this](const RawAddress& bda) { return return_value; }};
+ uint8_t operator()(const RawAddress& bda) { return body(bda); };
+};
+extern struct bta_hh_find_cb bta_hh_find_cb;
+
+// Name: bta_hh_get_cb
+// Params: const RawAddress& bda
+// Return: tBTA_HH_DEV_CB*
+struct bta_hh_get_cb {
+ tBTA_HH_DEV_CB* return_value{0};
+ std::function<tBTA_HH_DEV_CB*(const RawAddress& bda)> body{
+ [this](const RawAddress& bda) { return return_value; }};
+ tBTA_HH_DEV_CB* operator()(const RawAddress& bda) { return body(bda); };
+};
+extern struct bta_hh_get_cb bta_hh_get_cb;
+
+// Name: bta_hh_read_ssr_param
+// Params: const RawAddress& bd_addr, uint16_t* p_max_ssr_lat, uint16_t*
+// p_min_ssr_tout Return: tBTA_HH_STATUS
+struct bta_hh_read_ssr_param {
+ tBTA_HH_STATUS return_value{0};
+ std::function<tBTA_HH_STATUS(const RawAddress& bd_addr,
+ uint16_t* p_max_ssr_lat,
+ uint16_t* p_min_ssr_tout)>
+ body{[this](const RawAddress& bd_addr, uint16_t* p_max_ssr_lat,
+ uint16_t* p_min_ssr_tout) { return return_value; }};
+ tBTA_HH_STATUS operator()(const RawAddress& bd_addr, uint16_t* p_max_ssr_lat,
+ uint16_t* p_min_ssr_tout) {
+ return body(bd_addr, p_max_ssr_lat, p_min_ssr_tout);
+ };
+};
+extern struct bta_hh_read_ssr_param bta_hh_read_ssr_param;
+
+// Name: bta_hh_tod_spt
+// Params: tBTA_HH_DEV_CB* p_cb, uint8_t sub_class
+// Return: bool
+struct bta_hh_tod_spt {
+ bool return_value{false};
+ std::function<bool(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class)> body{
+ [this](tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) { return return_value; }};
+ bool operator()(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) {
+ return body(p_cb, sub_class);
+ };
+};
+extern struct bta_hh_tod_spt bta_hh_tod_spt;
+
+// Name: bta_hh_trace_dev_db
+// Params: void
+// Return: void
+struct bta_hh_trace_dev_db {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct bta_hh_trace_dev_db bta_hh_trace_dev_db;
+
+// Name: bta_hh_update_di_info
+// Params: tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
+// uint16_t version, uint8_t flag Return: void
+struct bta_hh_update_di_info {
+ std::function<void(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
+ uint16_t product_id, uint16_t version, uint8_t flag)>
+ body{[](tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
+ uint16_t version, uint8_t flag) {}};
+ void operator()(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
+ uint16_t version, uint8_t flag) {
+ body(p_cb, vendor_id, product_id, version, flag);
+ };
+};
+extern struct bta_hh_update_di_info bta_hh_update_di_info;
+
+} // namespace bta_hh_utils
+} // namespace mock
+} // namespace test
+
+// END mockcify generation \ No newline at end of file
diff --git a/system/test/mock/mock_bta_sys_main.cc b/system/test/mock/mock_bta_sys_main.cc
index 98713490b9..5b74faa996 100644
--- a/system/test/mock/mock_bta_sys_main.cc
+++ b/system/test/mock/mock_bta_sys_main.cc
@@ -17,48 +17,84 @@
/*
* Generated mock file from original source file
* Functions generated:10
+ *
+ * mockcify.pl ver 0.3.0
*/
+#include <cstdint>
+#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
-#include <base/bind.h>
-#include <cstring>
-#include "bt_target.h"
-#include "bta/sys/bta_sys.h"
-#include "bta/sys/bta_sys_int.h"
-#include "include/hardware/bluetooth.h"
-#include "osi/include/alarm.h"
-#include "osi/include/allocator.h"
-#include "osi/include/log.h"
-#include "stack/include/bt_types.h"
-#include "stack/include/btu.h"
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_bta_sys_main.h"
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
+// Mocked internal structures, if any
-bool bta_sys_is_register(uint8_t id) {
+namespace test {
+namespace mock {
+namespace bta_sys_main {
+
+// Function state capture and return values, if needed
+struct BTA_sys_signal_hw_error BTA_sys_signal_hw_error;
+struct bta_set_forward_hw_failures bta_set_forward_hw_failures;
+struct bta_sys_deregister bta_sys_deregister;
+struct bta_sys_disable bta_sys_disable;
+struct bta_sys_init bta_sys_init;
+struct bta_sys_is_register bta_sys_is_register;
+struct bta_sys_register bta_sys_register;
+struct bta_sys_sendmsg bta_sys_sendmsg;
+struct bta_sys_sendmsg_delayed bta_sys_sendmsg_delayed;
+struct bta_sys_start_timer bta_sys_start_timer;
+
+} // namespace bta_sys_main
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void BTA_sys_signal_hw_error() {
mock_function_count_map[__func__]++;
- return false;
+ test::mock::bta_sys_main::BTA_sys_signal_hw_error();
}
-void BTA_sys_signal_hw_error() { mock_function_count_map[__func__]++; }
void bta_set_forward_hw_failures(bool value) {
mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_set_forward_hw_failures(value);
+}
+void bta_sys_deregister(uint8_t id) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_deregister(id);
+}
+void bta_sys_disable() {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_disable();
+}
+void bta_sys_init(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_init();
+}
+bool bta_sys_is_register(uint8_t id) {
+ mock_function_count_map[__func__]++;
+ return test::mock::bta_sys_main::bta_sys_is_register(id);
}
-void bta_sys_deregister(uint8_t id) { mock_function_count_map[__func__]++; }
-void bta_sys_disable() { mock_function_count_map[__func__]++; }
-void bta_sys_init(void) { mock_function_count_map[__func__]++; }
void bta_sys_register(uint8_t id, const tBTA_SYS_REG* p_reg) {
mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_register(id, p_reg);
+}
+void bta_sys_sendmsg(void* p_msg) {
+ mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_sendmsg(p_msg);
}
-void bta_sys_sendmsg(void* p_msg) { mock_function_count_map[__func__]++; }
void bta_sys_sendmsg_delayed(void* p_msg, const base::TimeDelta& delay) {
mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_sendmsg_delayed(p_msg, delay);
}
void bta_sys_start_timer(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
uint16_t layer_specific) {
mock_function_count_map[__func__]++;
+ test::mock::bta_sys_main::bta_sys_start_timer(alarm, interval_ms, event,
+ layer_specific);
}
+// Mocked functions complete
+// END mockcify generation
diff --git a/system/test/mock/mock_bta_sys_main.h b/system/test/mock/mock_bta_sys_main.h
new file mode 100644
index 0000000000..95bc473847
--- /dev/null
+++ b/system/test/mock/mock_bta_sys_main.h
@@ -0,0 +1,166 @@
+/*
+ * 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:10
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include <base/bind.h>
+
+#include <cstring>
+#include <map>
+#include <string>
+
+#include "bt_target.h"
+#include "bta/sys/bta_sys.h"
+#include "bta/sys/bta_sys_int.h"
+#include "include/hardware/bluetooth.h"
+#include "osi/include/alarm.h"
+#include "osi/include/allocator.h"
+#include "osi/include/log.h"
+#include "stack/include/bt_types.h"
+#include "stack/include/btu.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace bta_sys_main {
+
+// Shared state between mocked functions and tests
+// Name: BTA_sys_signal_hw_error
+// Params:
+// Return: void
+struct BTA_sys_signal_hw_error {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct BTA_sys_signal_hw_error BTA_sys_signal_hw_error;
+
+// Name: bta_set_forward_hw_failures
+// Params: bool value
+// Return: void
+struct bta_set_forward_hw_failures {
+ std::function<void(bool value)> body{[](bool value) {}};
+ void operator()(bool value) { body(value); };
+};
+extern struct bta_set_forward_hw_failures bta_set_forward_hw_failures;
+
+// Name: bta_sys_deregister
+// Params: uint8_t id
+// Return: void
+struct bta_sys_deregister {
+ std::function<void(uint8_t id)> body{[](uint8_t id) {}};
+ void operator()(uint8_t id) { body(id); };
+};
+extern struct bta_sys_deregister bta_sys_deregister;
+
+// Name: bta_sys_disable
+// Params:
+// Return: void
+struct bta_sys_disable {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct bta_sys_disable bta_sys_disable;
+
+// Name: bta_sys_init
+// Params: void
+// Return: void
+struct bta_sys_init {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct bta_sys_init bta_sys_init;
+
+// Name: bta_sys_is_register
+// Params: uint8_t id
+// Return: bool
+struct bta_sys_is_register {
+ bool return_value{false};
+ std::function<bool(uint8_t id)> body{
+ [this](uint8_t id) { return return_value; }};
+ bool operator()(uint8_t id) { return body(id); };
+};
+extern struct bta_sys_is_register bta_sys_is_register;
+
+// Name: bta_sys_register
+// Params: uint8_t id, const tBTA_SYS_REG* p_reg
+// Return: void
+struct bta_sys_register {
+ std::function<void(uint8_t id, const tBTA_SYS_REG* p_reg)> body{
+ [](uint8_t id, const tBTA_SYS_REG* p_reg) {}};
+ void operator()(uint8_t id, const tBTA_SYS_REG* p_reg) { body(id, p_reg); };
+};
+extern struct bta_sys_register bta_sys_register;
+
+// Name: bta_sys_sendmsg
+// Params: void* p_msg
+// Return: void
+struct bta_sys_sendmsg {
+ std::function<void(void* p_msg)> body{[](void* p_msg) {}};
+ void operator()(void* p_msg) { body(p_msg); };
+};
+extern struct bta_sys_sendmsg bta_sys_sendmsg;
+
+// Name: bta_sys_sendmsg_delayed
+// Params: void* p_msg, const base::TimeDelta& delay
+// Return: void
+struct bta_sys_sendmsg_delayed {
+ std::function<void(void* p_msg, const base::TimeDelta& delay)> body{
+ [](void* p_msg, const base::TimeDelta& delay) {}};
+ void operator()(void* p_msg, const base::TimeDelta& delay) {
+ body(p_msg, delay);
+ };
+};
+extern struct bta_sys_sendmsg_delayed bta_sys_sendmsg_delayed;
+
+// Name: bta_sys_start_timer
+// Params: alarm_t* alarm, uint64_t interval_ms, uint16_t event, uint16_t
+// layer_specific Return: void
+struct bta_sys_start_timer {
+ std::function<void(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
+ uint16_t layer_specific)>
+ body{[](alarm_t* alarm, uint64_t interval_ms, uint16_t event,
+ uint16_t layer_specific) {}};
+ void operator()(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
+ uint16_t layer_specific) {
+ body(alarm, interval_ms, event, layer_specific);
+ };
+};
+extern struct bta_sys_start_timer bta_sys_start_timer;
+
+} // namespace bta_sys_main
+} // namespace mock
+} // namespace test
+
+// END mockcify generation \ No newline at end of file
diff --git a/system/test/mock/mock_btcore_module.cc b/system/test/mock/mock_btcore_module.cc
index c83cb9deb6..1b53b7a5a1 100644
--- a/system/test/mock/mock_btcore_module.cc
+++ b/system/test/mock/mock_btcore_module.cc
@@ -16,46 +16,68 @@
/*
* Generated mock file from original source file
- * Functions generated:8
+ * Functions generated:7
+ *
+ * mockcify.pl ver 0.3.0
*/
+#include <cstdint>
+#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
-#include <base/logging.h>
-#include <dlfcn.h>
-#include <string.h>
-#include <mutex>
-#include <unordered_map>
-#include "btcore/include/module.h"
-#include "common/message_loop_thread.h"
-#include "osi/include/allocator.h"
-#include "osi/include/log.h"
-#include "osi/include/osi.h"
-
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_btcore_module.h"
-bool module_init(const module_t* module) {
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace btcore_module {
+
+// Function state capture and return values, if needed
+struct get_module get_module;
+struct module_clean_up module_clean_up;
+struct module_init module_init;
+struct module_management_start module_management_start;
+struct module_management_stop module_management_stop;
+struct module_shut_down module_shut_down;
+struct module_start_up module_start_up;
+
+} // namespace btcore_module
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+const module_t* get_module(const char* name) {
mock_function_count_map[__func__]++;
- return false;
+ return test::mock::btcore_module::get_module(name);
}
-bool module_start_up(const module_t* module) {
+void module_clean_up(const module_t* module) {
mock_function_count_map[__func__]++;
- return false;
+ test::mock::btcore_module::module_clean_up(module);
}
-const module_t* get_module(const char* name) {
+bool module_init(const module_t* module) {
mock_function_count_map[__func__]++;
- return nullptr;
+ return test::mock::btcore_module::module_init(module);
}
-void module_management_start(void) { mock_function_count_map[__func__]++; }
-void module_clean_up(const module_t* module) {
+void module_management_start(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::btcore_module::module_management_start();
+}
+void module_management_stop(void) {
mock_function_count_map[__func__]++;
+ test::mock::btcore_module::module_management_stop();
}
-void module_management_stop(void) { mock_function_count_map[__func__]++; }
void module_shut_down(const module_t* module) {
mock_function_count_map[__func__]++;
+ test::mock::btcore_module::module_shut_down(module);
+}
+bool module_start_up(const module_t* module) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btcore_module::module_start_up(module);
}
+// Mocked functions complete
+// END mockcify generation
diff --git a/system/test/mock/mock_btcore_module.h b/system/test/mock/mock_btcore_module.h
new file mode 100644
index 0000000000..31bbb5496e
--- /dev/null
+++ b/system/test/mock/mock_btcore_module.h
@@ -0,0 +1,133 @@
+/*
+ * 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:7
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include <base/logging.h>
+#include <dlfcn.h>
+#include <string.h>
+
+#include <mutex>
+#include <unordered_map>
+
+#include "btcore/include/module.h"
+#include "check.h"
+#include "common/message_loop_thread.h"
+#include "osi/include/allocator.h"
+#include "osi/include/log.h"
+#include "osi/include/osi.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace btcore_module {
+
+// Shared state between mocked functions and tests
+// Name: get_module
+// Params: const char* name
+// Return: const module_t*
+struct get_module {
+ const module_t* return_value{0};
+ std::function<const module_t*(const char* name)> body{
+ [this](const char* name) { return return_value; }};
+ const module_t* operator()(const char* name) { return body(name); };
+};
+extern struct get_module get_module;
+
+// Name: module_clean_up
+// Params: const module_t* module
+// Return: void
+struct module_clean_up {
+ std::function<void(const module_t* module)> body{
+ [](const module_t* module) {}};
+ void operator()(const module_t* module) { body(module); };
+};
+extern struct module_clean_up module_clean_up;
+
+// Name: module_init
+// Params: const module_t* module
+// Return: bool
+struct module_init {
+ bool return_value{false};
+ std::function<bool(const module_t* module)> body{
+ [this](const module_t* module) { return return_value; }};
+ bool operator()(const module_t* module) { return body(module); };
+};
+extern struct module_init module_init;
+
+// Name: module_management_start
+// Params: void
+// Return: void
+struct module_management_start {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct module_management_start module_management_start;
+
+// Name: module_management_stop
+// Params: void
+// Return: void
+struct module_management_stop {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct module_management_stop module_management_stop;
+
+// Name: module_shut_down
+// Params: const module_t* module
+// Return: void
+struct module_shut_down {
+ std::function<void(const module_t* module)> body{
+ [](const module_t* module) {}};
+ void operator()(const module_t* module) { body(module); };
+};
+extern struct module_shut_down module_shut_down;
+
+// Name: module_start_up
+// Params: const module_t* module
+// Return: bool
+struct module_start_up {
+ bool return_value{false};
+ std::function<bool(const module_t* module)> body{
+ [this](const module_t* module) { return return_value; }};
+ bool operator()(const module_t* module) { return body(module); };
+};
+extern struct module_start_up module_start_up;
+
+} // namespace btcore_module
+} // namespace mock
+} // namespace test
+
+// END mockcify generation \ No newline at end of file
diff --git a/system/test/mock/mock_device_esco_parameters.cc b/system/test/mock/mock_device_esco_parameters.cc
new file mode 100644
index 0000000000..86410fe16f
--- /dev/null
+++ b/system/test/mock/mock_device_esco_parameters.cc
@@ -0,0 +1,53 @@
+/*
+ * 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:1
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_device_esco_parameters.h"
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace device_esco_parameters {
+
+// Function state capture and return values, if needed
+struct esco_parameters_for_codec esco_parameters_for_codec;
+
+} // namespace device_esco_parameters
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+enh_esco_params_t esco_parameters_for_codec(esco_codec_t codec) {
+ mock_function_count_map[__func__]++;
+ return test::mock::device_esco_parameters::esco_parameters_for_codec(codec);
+}
+// Mocked functions complete
+// END mockcify generation
diff --git a/system/test/mock/mock_device_esco_parameters.h b/system/test/mock/mock_device_esco_parameters.h
new file mode 100644
index 0000000000..46116d9846
--- /dev/null
+++ b/system/test/mock/mock_device_esco_parameters.h
@@ -0,0 +1,63 @@
+/*
+ * 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:1
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include "base/logging.h"
+#include "check.h"
+#include "device/include/esco_parameters.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace device_esco_parameters {
+
+// Shared state between mocked functions and tests
+// Name: esco_parameters_for_codec
+// Params: esco_codec_t codec
+// Return: enh_esco_params_t
+struct esco_parameters_for_codec {
+ enh_esco_params_t return_value{};
+ std::function<enh_esco_params_t(esco_codec_t codec)> body{
+ [this](esco_codec_t codec) { return return_value; }};
+ enh_esco_params_t operator()(esco_codec_t codec) { return body(codec); };
+};
+extern struct esco_parameters_for_codec esco_parameters_for_codec;
+
+} // namespace device_esco_parameters
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
diff --git a/system/test/mock/mock_utils_bt.cc b/system/test/mock/mock_utils_bt.cc
new file mode 100644
index 0000000000..5b6bfc2439
--- /dev/null
+++ b/system/test/mock/mock_utils_bt.cc
@@ -0,0 +1,62 @@
+/*
+ * 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:1
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_utils_bt.h"
+
+// Legacy module structure
+#if 0
+EXPORT_SYMBOL extern const module_t module_s = {.name = BT_UTILS_MODULE,
+ .init = nullptr,
+ .start_up = nullptr,
+ .shut_down = nullptr,
+ .clean_up = nullptr,
+ .dependencies = {nullptr}};
+#endif
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace utils_bt {
+
+// Function state capture and return values, if needed
+struct raise_priority_a2dp raise_priority_a2dp;
+
+} // namespace utils_bt
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void raise_priority_a2dp(tHIGH_PRIORITY_TASK high_task) {
+ mock_function_count_map[__func__]++;
+ test::mock::utils_bt::raise_priority_a2dp(high_task);
+}
+// Mocked functions complete
+// END mockcify generation
diff --git a/system/test/mock/mock_utils_bt.h b/system/test/mock/mock_utils_bt.h
new file mode 100644
index 0000000000..1b0b8a1671
--- /dev/null
+++ b/system/test/mock/mock_utils_bt.h
@@ -0,0 +1,75 @@
+/*
+ * 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:1
+ *
+ * mockcify.pl ver 0.3.0
+ */
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <string>
+
+extern std::map<std::string, int> mock_function_count_map;
+
+// Original included files, if any
+// NOTE: Since this is a mock file with mock definitions some number of
+// include files may not be required. The include-what-you-use
+// still applies, but crafting proper inclusion is out of scope
+// for this effort. This compilation unit may compile as-is, or
+// may need attention to prune from (or add to ) the inclusion set.
+#include <errno.h>
+#include <processgroup/sched_policy.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+#include <mutex>
+
+#include "bt_types.h"
+#include "bt_utils.h"
+#include "btcore/include/module.h"
+#include "osi/include/compat.h"
+#include "osi/include/log.h"
+#include "osi/include/properties.h"
+
+// Mocked compile conditionals, if any
+
+namespace test {
+namespace mock {
+namespace utils_bt {
+
+// Shared state between mocked functions and tests
+// Name: raise_priority_a2dp
+// Params: tHIGH_PRIORITY_TASK high_task
+// Return: void
+struct raise_priority_a2dp {
+ std::function<void(tHIGH_PRIORITY_TASK high_task)> body{
+ [](tHIGH_PRIORITY_TASK high_task) {}};
+ void operator()(tHIGH_PRIORITY_TASK high_task) { body(high_task); };
+};
+extern struct raise_priority_a2dp raise_priority_a2dp;
+
+} // namespace utils_bt
+} // namespace mock
+} // namespace test
+
+// END mockcify generation \ No newline at end of file