1 /*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /*
18 * Generated mock file from original source file
19 * Functions generated:47
20 */
21
22 #include <map>
23 #include <string>
24
25 extern std::map<std::string, int> mock_function_count_map;
26
27 #include <base/bind.h>
28 #include <base/strings/string_number_conversions.h>
29 #include <cstdint>
30 #include <list>
31 #include <memory>
32 #include <vector>
33 #include "common/time_util.h"
34 #include "device/include/controller.h"
35 #include "main/shim/acl_api.h"
36 #include "main/shim/btm_api.h"
37 #include "main/shim/shim.h"
38 #include "osi/include/log.h"
39 #include "stack/btm/btm_ble_int.h"
40 #include "stack/btm/btm_ble_int_types.h"
41 #include "stack/btm/btm_dev.h"
42 #include "stack/btm/btm_int_types.h"
43 #include "stack/gatt/gatt_int.h"
44 #include "stack/include/acl_api.h"
45 #include "stack/include/advertise_data_parser.h"
46 #include "stack/include/bt_types.h"
47 #include "stack/include/btm_api_types.h"
48 #include "stack/include/gap_api.h"
49 #include "stack/include/hci_error_code.h"
50 #include "stack/include/hcimsgs.h"
51 #include "stack/include/inq_hci_link_interface.h"
52 #include "types/raw_address.h"
53
54 #ifndef UNUSED_ATTR
55 #define UNUSED_ATTR
56 #endif
57
BTM_BleConfigPrivacy(bool privacy_mode)58 bool BTM_BleConfigPrivacy(bool privacy_mode) {
59 mock_function_count_map[__func__]++;
60 return false;
61 }
BTM_BleLocalPrivacyEnabled(void)62 bool BTM_BleLocalPrivacyEnabled(void) {
63 mock_function_count_map[__func__]++;
64 return false;
65 }
btm_ble_cancel_remote_name(const RawAddress & remote_bda)66 bool btm_ble_cancel_remote_name(const RawAddress& remote_bda) {
67 mock_function_count_map[__func__]++;
68 return false;
69 }
btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state_mask)70 bool btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state_mask) {
71 mock_function_count_map[__func__]++;
72 return false;
73 }
btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state_mask)74 bool btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state_mask) {
75 mock_function_count_map[__func__]++;
76 return false;
77 }
btm_ble_topology_check(tBTM_BLE_STATE_MASK request_state_mask)78 bool btm_ble_topology_check(tBTM_BLE_STATE_MASK request_state_mask) {
79 mock_function_count_map[__func__]++;
80 return false;
81 }
BTM_BleObserve(bool start,uint8_t duration,tBTM_INQ_RESULTS_CB * p_results_cb,tBTM_CMPL_CB * p_cmpl_cb)82 tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration,
83 tBTM_INQ_RESULTS_CB* p_results_cb,
84 tBTM_CMPL_CB* p_cmpl_cb) {
85 mock_function_count_map[__func__]++;
86 return BTM_SUCCESS;
87 }
btm_ble_read_remote_name(const RawAddress & remote_bda,tBTM_CMPL_CB * p_cb)88 tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda,
89 tBTM_CMPL_CB* p_cb) {
90 mock_function_count_map[__func__]++;
91 return BTM_SUCCESS;
92 }
btm_ble_set_connectability(uint16_t combined_mode)93 tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode) {
94 mock_function_count_map[__func__]++;
95 return BTM_SUCCESS;
96 }
btm_ble_set_discoverability(uint16_t combined_mode)97 tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) {
98 mock_function_count_map[__func__]++;
99 return BTM_SUCCESS;
100 }
btm_ble_start_adv(void)101 tBTM_STATUS btm_ble_start_adv(void) {
102 mock_function_count_map[__func__]++;
103 return BTM_SUCCESS;
104 }
btm_ble_start_inquiry(uint8_t duration)105 tBTM_STATUS btm_ble_start_inquiry(uint8_t duration) {
106 mock_function_count_map[__func__]++;
107 return BTM_SUCCESS;
108 }
btm_ble_stop_adv(void)109 tBTM_STATUS btm_ble_stop_adv(void) {
110 mock_function_count_map[__func__]++;
111 return BTM_SUCCESS;
112 }
BTM_BleReadConnectability()113 uint16_t BTM_BleReadConnectability() {
114 mock_function_count_map[__func__]++;
115 return 0;
116 }
BTM_BleReadDiscoverability()117 uint16_t BTM_BleReadDiscoverability() {
118 mock_function_count_map[__func__]++;
119 return 0;
120 }
BTM_BleMaxMultiAdvInstanceCount(void)121 uint8_t BTM_BleMaxMultiAdvInstanceCount(void) {
122 mock_function_count_map[__func__]++;
123 return 0;
124 }
BTM_BleGetDynamicAudioBuffer(tBTM_BT_DYNAMIC_AUDIO_BUFFER_CB p_dynamic_audio_buffer_cb[])125 void BTM_BleGetDynamicAudioBuffer(
126 tBTM_BT_DYNAMIC_AUDIO_BUFFER_CB p_dynamic_audio_buffer_cb[]) {
127 mock_function_count_map[__func__]++;
128 }
BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB * p_cmn_vsc_cb)129 void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB* p_cmn_vsc_cb) {
130 mock_function_count_map[__func__]++;
131 }
BTM_BleSetScanParams(uint32_t scan_interval,uint32_t scan_window,tBLE_SCAN_MODE scan_mode,base::Callback<void (uint8_t)> cb)132 void BTM_BleSetScanParams(uint32_t scan_interval, uint32_t scan_window,
133 tBLE_SCAN_MODE scan_mode,
134 base::Callback<void(uint8_t)> cb) {
135 mock_function_count_map[__func__]++;
136 }
btm_ble_decrement_link_topology_mask(uint8_t link_role)137 void btm_ble_decrement_link_topology_mask(uint8_t link_role) {
138 mock_function_count_map[__func__]++;
139 }
btm_ble_dir_adv_tout(void)140 void btm_ble_dir_adv_tout(void) { mock_function_count_map[__func__]++; }
btm_ble_free()141 void btm_ble_free() { mock_function_count_map[__func__]++; }
btm_ble_increment_link_topology_mask(uint8_t link_role)142 void btm_ble_increment_link_topology_mask(uint8_t link_role) {
143 mock_function_count_map[__func__]++;
144 }
btm_ble_init(void)145 void btm_ble_init(void) { mock_function_count_map[__func__]++; }
btm_ble_process_adv_addr(RawAddress & bda,uint8_t * addr_type)146 void btm_ble_process_adv_addr(RawAddress& bda, uint8_t* addr_type) {
147 mock_function_count_map[__func__]++;
148 }
btm_ble_process_adv_pkt(uint8_t data_len,uint8_t * data)149 void btm_ble_process_adv_pkt(uint8_t data_len, uint8_t* data) {
150 mock_function_count_map[__func__]++;
151 }
btm_ble_process_adv_pkt_cont(uint16_t evt_type,uint8_t addr_type,const RawAddress & bda,uint8_t primary_phy,uint8_t secondary_phy,uint8_t advertising_sid,int8_t tx_power,int8_t rssi,uint16_t periodic_adv_int,uint8_t data_len,uint8_t * data,const RawAddress & original_bda)152 void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type,
153 const RawAddress& bda, uint8_t primary_phy,
154 uint8_t secondary_phy,
155 uint8_t advertising_sid, int8_t tx_power,
156 int8_t rssi, uint16_t periodic_adv_int,
157 uint8_t data_len, uint8_t* data, const RawAddress& original_bda) {
158 mock_function_count_map[__func__]++;
159 }
btm_ble_process_adv_pkt_cont_for_inquiry(uint16_t evt_type,uint8_t addr_type,const RawAddress & bda,uint8_t primary_phy,uint8_t secondary_phy,uint8_t advertising_sid,int8_t tx_power,int8_t rssi,uint16_t periodic_adv_int,std::vector<uint8_t> advertising_data)160 void btm_ble_process_adv_pkt_cont_for_inquiry(
161 uint16_t evt_type, uint8_t addr_type, const RawAddress& bda,
162 uint8_t primary_phy, uint8_t secondary_phy, uint8_t advertising_sid,
163 int8_t tx_power, int8_t rssi, uint16_t periodic_adv_int,
164 std::vector<uint8_t> advertising_data) {
165 mock_function_count_map[__func__]++;
166 }
btm_ble_process_ext_adv_pkt(uint8_t data_len,uint8_t * data)167 void btm_ble_process_ext_adv_pkt(uint8_t data_len, uint8_t* data) {
168 mock_function_count_map[__func__]++;
169 }
btm_ble_process_phy_update_pkt(uint8_t len,uint8_t * data)170 void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* data) {
171 mock_function_count_map[__func__]++;
172 }
btm_ble_read_remote_features_complete(uint8_t * p)173 void btm_ble_read_remote_features_complete(uint8_t* p) {
174 mock_function_count_map[__func__]++;
175 }
btm_ble_read_remote_name_cmpl(bool status,const RawAddress & bda,uint16_t length,char * p_name)176 void btm_ble_read_remote_name_cmpl(bool status, const RawAddress& bda,
177 uint16_t length, char* p_name) {
178 mock_function_count_map[__func__]++;
179 }
btm_ble_set_adv_flag(uint16_t connect_mode,uint16_t disc_mode)180 void btm_ble_set_adv_flag(uint16_t connect_mode, uint16_t disc_mode) {
181 mock_function_count_map[__func__]++;
182 }
btm_ble_start_scan()183 void btm_ble_start_scan() { mock_function_count_map[__func__]++; }
btm_ble_stop_inquiry(void)184 void btm_ble_stop_inquiry(void) { mock_function_count_map[__func__]++; }
btm_ble_stop_scan(void)185 void btm_ble_stop_scan(void) { mock_function_count_map[__func__]++; }
btm_ble_update_dmt_flag_bits(uint8_t * adv_flag_value,const uint16_t connect_mode,const uint16_t disc_mode)186 void btm_ble_update_dmt_flag_bits(uint8_t* adv_flag_value,
187 const uint16_t connect_mode,
188 const uint16_t disc_mode) {
189 mock_function_count_map[__func__]++;
190 }
btm_ble_update_inq_result(tINQ_DB_ENT * p_i,uint8_t addr_type,const RawAddress & bda,uint16_t evt_type,uint8_t primary_phy,uint8_t secondary_phy,uint8_t advertising_sid,int8_t tx_power,int8_t rssi,uint16_t periodic_adv_int,std::vector<uint8_t> const & data)191 void btm_ble_update_inq_result(tINQ_DB_ENT* p_i, uint8_t addr_type,
192 const RawAddress& bda, uint16_t evt_type,
193 uint8_t primary_phy, uint8_t secondary_phy,
194 uint8_t advertising_sid, int8_t tx_power,
195 int8_t rssi, uint16_t periodic_adv_int,
196 std::vector<uint8_t> const& data) {
197 mock_function_count_map[__func__]++;
198 }
btm_ble_update_mode_operation(uint8_t link_role,const RawAddress * bd_addr,tHCI_STATUS status)199 void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr,
200 tHCI_STATUS status) {
201 mock_function_count_map[__func__]++;
202 }
btm_ble_write_adv_enable_complete(uint8_t * p)203 void btm_ble_write_adv_enable_complete(uint8_t* p) {
204 mock_function_count_map[__func__]++;
205 }
btm_clear_all_pending_le_entry(void)206 void btm_clear_all_pending_le_entry(void) {
207 mock_function_count_map[__func__]++;
208 }
btm_send_hci_set_scan_params(uint8_t scan_type,uint16_t scan_int,uint16_t scan_win,uint8_t addr_type_own,uint8_t scan_filter_policy)209 void btm_send_hci_set_scan_params(uint8_t scan_type, uint16_t scan_int,
210 uint16_t scan_win, uint8_t addr_type_own,
211 uint8_t scan_filter_policy) {
212 mock_function_count_map[__func__]++;
213 }
214