1 /*
2 * Copyright 2023 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 * Generated mock file from original source file
18 * Functions generated:43
19 *
20 * mockcify.pl ver 0.6.0
21 */
22 // Mock include file to share data between tests and mock
23 #include "test/mock/mock_btif_av.h"
24
25 #include <btif/include/btif_av.h>
26
27 #include <cstdint>
28
29 #include "test/common/mock_functions.h"
30
31 // Original usings
32
33 // Mocked internal structures, if any
34
35 namespace test {
36 namespace mock {
37 namespace btif_av {
38
39 // Function state capture and return values, if needed
40 struct btif_av_acl_disconnected btif_av_acl_disconnected;
41 struct btif_av_clear_remote_suspend_flag btif_av_clear_remote_suspend_flag;
42 struct btif_av_find_by_handle btif_av_find_by_handle;
43 struct btif_av_get_audio_delay btif_av_get_audio_delay;
44 struct btif_av_get_peer_sep btif_av_get_peer_sep;
45 struct btif_av_get_sink_interface btif_av_get_sink_interface;
46 struct btif_av_get_src_interface btif_av_get_src_interface;
47 struct btif_av_is_a2dp_offload_enabled btif_av_is_a2dp_offload_enabled;
48 struct btif_av_is_a2dp_offload_running btif_av_is_a2dp_offload_running;
49 struct btif_av_is_connected btif_av_is_connected;
50 struct btif_av_is_connected_addr btif_av_is_connected_addr;
51 struct btif_av_is_peer_edr btif_av_is_peer_edr;
52 struct btif_av_is_peer_silenced btif_av_is_peer_silenced;
53 struct btif_av_is_sink_enabled btif_av_is_sink_enabled;
54 struct btif_av_is_source_enabled btif_av_is_source_enabled;
55 struct btif_av_peer_is_connected_sink btif_av_peer_is_connected_sink;
56 struct btif_av_peer_is_connected_source btif_av_peer_is_connected_source;
57 struct btif_av_peer_is_sink btif_av_peer_is_sink;
58 struct btif_av_peer_is_source btif_av_peer_is_source;
59 struct btif_av_peer_prefers_mandatory_codec
60 btif_av_peer_prefers_mandatory_codec;
61 struct btif_av_peer_supports_3mbps btif_av_peer_supports_3mbps;
62 struct btif_av_report_source_codec_state btif_av_report_source_codec_state;
63 struct btif_av_reset_audio_delay btif_av_reset_audio_delay;
64 struct btif_av_set_audio_delay btif_av_set_audio_delay;
65 struct btif_av_set_dynamic_audio_buffer_size
66 btif_av_set_dynamic_audio_buffer_size;
67 struct btif_av_set_low_latency btif_av_set_low_latency;
68 struct btif_av_sink_active_peer btif_av_sink_active_peer;
69 struct btif_av_sink_execute_service btif_av_sink_execute_service;
70 struct btif_av_source_active_peer btif_av_source_active_peer;
71 struct btif_av_source_execute_service btif_av_source_execute_service;
72 struct btif_av_src_disconnect_sink btif_av_src_disconnect_sink;
73 struct btif_av_src_sink_coexist_enabled btif_av_src_sink_coexist_enabled;
74 struct btif_av_stream_ready btif_av_stream_ready;
75 struct btif_av_stream_start btif_av_stream_start;
76 struct btif_av_stream_start_offload btif_av_stream_start_offload;
77 struct btif_av_stream_start_with_latency btif_av_stream_start_with_latency;
78 struct btif_av_stream_started_ready btif_av_stream_started_ready;
79 struct btif_av_stream_stop btif_av_stream_stop;
80 struct btif_av_stream_suspend btif_av_stream_suspend;
81 struct btif_debug_av_dump btif_debug_av_dump;
82 struct dump_av_sm_event_name dump_av_sm_event_name;
83
84 } // namespace btif_av
85 } // namespace mock
86 } // namespace test
87
88 // Mocked function return values, if any
89 namespace test {
90 namespace mock {
91 namespace btif_av {
92
93 const RawAddress& btif_av_find_by_handle::return_value = RawAddress::kEmpty;
94 uint16_t btif_av_get_audio_delay::return_value = 0;
95 uint8_t btif_av_get_peer_sep::return_value = 0;
96 const btav_sink_interface_t* btif_av_get_sink_interface::return_value = nullptr;
97 const btav_source_interface_t* btif_av_get_src_interface::return_value =
98 nullptr;
99 bool btif_av_is_a2dp_offload_enabled::return_value = false;
100 bool btif_av_is_a2dp_offload_running::return_value = false;
101 bool btif_av_is_connected::return_value = false;
102 bool btif_av_is_connected_addr::return_value = false;
103 bool btif_av_is_peer_edr::return_value = false;
104 bool btif_av_is_peer_silenced::return_value = false;
105 bool btif_av_is_sink_enabled::return_value = false;
106 bool btif_av_is_source_enabled::return_value = false;
107 bool btif_av_peer_is_connected_sink::return_value = false;
108 bool btif_av_peer_is_connected_source::return_value = false;
109 bool btif_av_peer_is_sink::return_value = false;
110 bool btif_av_peer_is_source::return_value = false;
111 bool btif_av_peer_prefers_mandatory_codec::return_value = false;
112 bool btif_av_peer_supports_3mbps::return_value = false;
113 RawAddress btif_av_sink_active_peer::return_value;
114 bt_status_t btif_av_sink_execute_service::return_value = BT_STATUS_SUCCESS;
115 RawAddress btif_av_source_active_peer::return_value;
116 bt_status_t btif_av_source_execute_service::return_value = BT_STATUS_SUCCESS;
117 bool btif_av_src_sink_coexist_enabled::return_value = false;
118 bool btif_av_stream_ready::return_value = false;
119 bool btif_av_stream_started_ready::return_value = false;
120 const char* dump_av_sm_event_name::return_value = nullptr;
121
122 } // namespace btif_av
123 } // namespace mock
124 } // namespace test
125
126 // Mocked functions, if any
btif_av_acl_disconnected(const RawAddress & peer_address,const A2dpType local_a2dp_type)127 void btif_av_acl_disconnected(const RawAddress& peer_address,
128 const A2dpType local_a2dp_type) {
129 inc_func_call_count(__func__);
130 test::mock::btif_av::btif_av_acl_disconnected(peer_address, local_a2dp_type);
131 }
btif_av_clear_remote_suspend_flag(const A2dpType local_a2dp_type)132 void btif_av_clear_remote_suspend_flag(const A2dpType local_a2dp_type) {
133 inc_func_call_count(__func__);
134 test::mock::btif_av::btif_av_clear_remote_suspend_flag(local_a2dp_type);
135 }
btif_av_find_by_handle(tBTA_AV_HNDL bta_handle)136 const RawAddress& btif_av_find_by_handle(tBTA_AV_HNDL bta_handle) {
137 inc_func_call_count(__func__);
138 return test::mock::btif_av::btif_av_find_by_handle(bta_handle);
139 }
btif_av_get_audio_delay(const A2dpType local_a2dp_type)140 uint16_t btif_av_get_audio_delay(const A2dpType local_a2dp_type) {
141 inc_func_call_count(__func__);
142 return test::mock::btif_av::btif_av_get_audio_delay(local_a2dp_type);
143 }
btif_av_get_peer_sep(const A2dpType local_a2dp_type)144 uint8_t btif_av_get_peer_sep(const A2dpType local_a2dp_type) {
145 inc_func_call_count(__func__);
146 return test::mock::btif_av::btif_av_get_peer_sep(local_a2dp_type);
147 }
btif_av_get_sink_interface(void)148 const btav_sink_interface_t* btif_av_get_sink_interface(void) {
149 inc_func_call_count(__func__);
150 return test::mock::btif_av::btif_av_get_sink_interface();
151 }
btif_av_get_src_interface(void)152 const btav_source_interface_t* btif_av_get_src_interface(void) {
153 inc_func_call_count(__func__);
154 return test::mock::btif_av::btif_av_get_src_interface();
155 }
btif_av_is_a2dp_offload_enabled()156 bool btif_av_is_a2dp_offload_enabled() {
157 inc_func_call_count(__func__);
158 return test::mock::btif_av::btif_av_is_a2dp_offload_enabled();
159 }
btif_av_is_a2dp_offload_running()160 bool btif_av_is_a2dp_offload_running() {
161 inc_func_call_count(__func__);
162 return test::mock::btif_av::btif_av_is_a2dp_offload_running();
163 }
btif_av_is_connected(const A2dpType local_a2dp_type)164 bool btif_av_is_connected(const A2dpType local_a2dp_type) {
165 inc_func_call_count(__func__);
166 return test::mock::btif_av::btif_av_is_connected(local_a2dp_type);
167 }
btif_av_is_connected_addr(const RawAddress & peer_address,const A2dpType local_a2dp_type)168 bool btif_av_is_connected_addr(const RawAddress& peer_address,
169 const A2dpType local_a2dp_type) {
170 inc_func_call_count(__func__);
171 return test::mock::btif_av::btif_av_is_connected_addr(peer_address,
172 local_a2dp_type);
173 }
btif_av_is_peer_edr(const RawAddress & peer_address,const A2dpType local_a2dp_type)174 bool btif_av_is_peer_edr(const RawAddress& peer_address,
175 const A2dpType local_a2dp_type) {
176 inc_func_call_count(__func__);
177 return test::mock::btif_av::btif_av_is_peer_edr(peer_address,
178 local_a2dp_type);
179 }
btif_av_is_peer_silenced(const RawAddress & peer_address)180 bool btif_av_is_peer_silenced(const RawAddress& peer_address) {
181 inc_func_call_count(__func__);
182 return test::mock::btif_av::btif_av_is_peer_silenced(peer_address);
183 }
btif_av_is_sink_enabled(void)184 bool btif_av_is_sink_enabled(void) {
185 inc_func_call_count(__func__);
186 return test::mock::btif_av::btif_av_is_sink_enabled();
187 }
btif_av_is_source_enabled(void)188 bool btif_av_is_source_enabled(void) {
189 inc_func_call_count(__func__);
190 return test::mock::btif_av::btif_av_is_source_enabled();
191 }
btif_av_peer_is_connected_sink(const RawAddress & peer_address)192 bool btif_av_peer_is_connected_sink(const RawAddress& peer_address) {
193 inc_func_call_count(__func__);
194 return test::mock::btif_av::btif_av_peer_is_connected_sink(peer_address);
195 }
btif_av_peer_is_connected_source(const RawAddress & peer_address)196 bool btif_av_peer_is_connected_source(const RawAddress& peer_address) {
197 inc_func_call_count(__func__);
198 return test::mock::btif_av::btif_av_peer_is_connected_source(peer_address);
199 }
btif_av_peer_is_sink(const RawAddress & peer_address)200 bool btif_av_peer_is_sink(const RawAddress& peer_address) {
201 inc_func_call_count(__func__);
202 return test::mock::btif_av::btif_av_peer_is_sink(peer_address);
203 }
btif_av_peer_is_source(const RawAddress & peer_address)204 bool btif_av_peer_is_source(const RawAddress& peer_address) {
205 inc_func_call_count(__func__);
206 return test::mock::btif_av::btif_av_peer_is_source(peer_address);
207 }
btif_av_peer_prefers_mandatory_codec(const RawAddress & peer_address,const A2dpType local_a2dp_type)208 bool btif_av_peer_prefers_mandatory_codec(const RawAddress& peer_address,
209 const A2dpType local_a2dp_type) {
210 inc_func_call_count(__func__);
211 return test::mock::btif_av::btif_av_peer_prefers_mandatory_codec(
212 peer_address, local_a2dp_type);
213 }
btif_av_peer_supports_3mbps(const RawAddress & peer_address,const A2dpType local_a2dp_type)214 bool btif_av_peer_supports_3mbps(const RawAddress& peer_address,
215 const A2dpType local_a2dp_type) {
216 inc_func_call_count(__func__);
217 return test::mock::btif_av::btif_av_peer_supports_3mbps(peer_address,
218 local_a2dp_type);
219 }
btif_av_report_source_codec_state(const RawAddress & peer_address,const btav_a2dp_codec_config_t & codec_config,const std::vector<btav_a2dp_codec_config_t> & codecs_local_capabilities,const std::vector<btav_a2dp_codec_config_t> & codecs_selectable_capabilities)220 void btif_av_report_source_codec_state(
221 const RawAddress& peer_address,
222 const btav_a2dp_codec_config_t& codec_config,
223 const std::vector<btav_a2dp_codec_config_t>& codecs_local_capabilities,
224 const std::vector<btav_a2dp_codec_config_t>&
225 codecs_selectable_capabilities) {
226 inc_func_call_count(__func__);
227 test::mock::btif_av::btif_av_report_source_codec_state(
228 peer_address, codec_config, codecs_local_capabilities,
229 codecs_selectable_capabilities);
230 }
btif_av_reset_audio_delay(void)231 void btif_av_reset_audio_delay(void) {
232 inc_func_call_count(__func__);
233 test::mock::btif_av::btif_av_reset_audio_delay();
234 }
btif_av_set_audio_delay(const RawAddress & peer_address,uint16_t delay,const A2dpType local_a2dp_type)235 void btif_av_set_audio_delay(const RawAddress& peer_address, uint16_t delay,
236 const A2dpType local_a2dp_type) {
237 inc_func_call_count(__func__);
238 test::mock::btif_av::btif_av_set_audio_delay(peer_address, delay,
239 local_a2dp_type);
240 }
btif_av_set_dynamic_audio_buffer_size(uint8_t dynamic_audio_buffer_size)241 void btif_av_set_dynamic_audio_buffer_size(uint8_t dynamic_audio_buffer_size) {
242 inc_func_call_count(__func__);
243 test::mock::btif_av::btif_av_set_dynamic_audio_buffer_size(
244 dynamic_audio_buffer_size);
245 }
btif_av_set_low_latency(bool is_low_latency)246 void btif_av_set_low_latency(bool is_low_latency) {
247 inc_func_call_count(__func__);
248 test::mock::btif_av::btif_av_set_low_latency(is_low_latency);
249 }
btif_av_sink_active_peer(void)250 RawAddress btif_av_sink_active_peer(void) {
251 inc_func_call_count(__func__);
252 return test::mock::btif_av::btif_av_sink_active_peer();
253 }
btif_av_sink_execute_service(bool enable)254 bt_status_t btif_av_sink_execute_service(bool enable) {
255 inc_func_call_count(__func__);
256 return test::mock::btif_av::btif_av_sink_execute_service(enable);
257 }
btif_av_source_active_peer(void)258 RawAddress btif_av_source_active_peer(void) {
259 inc_func_call_count(__func__);
260 return test::mock::btif_av::btif_av_source_active_peer();
261 }
btif_av_source_execute_service(bool enable)262 bt_status_t btif_av_source_execute_service(bool enable) {
263 inc_func_call_count(__func__);
264 return test::mock::btif_av::btif_av_source_execute_service(enable);
265 }
btif_av_src_disconnect_sink(const RawAddress & peer_address)266 void btif_av_src_disconnect_sink(const RawAddress& peer_address) {
267 inc_func_call_count(__func__);
268 test::mock::btif_av::btif_av_src_disconnect_sink(peer_address);
269 }
btif_av_src_sink_coexist_enabled(void)270 bool btif_av_src_sink_coexist_enabled(void) {
271 inc_func_call_count(__func__);
272 return test::mock::btif_av::btif_av_src_sink_coexist_enabled();
273 }
btif_av_stream_ready(const A2dpType local_a2dp_type)274 bool btif_av_stream_ready(const A2dpType local_a2dp_type) {
275 inc_func_call_count(__func__);
276 return test::mock::btif_av::btif_av_stream_ready(local_a2dp_type);
277 }
btif_av_stream_start(const A2dpType local_a2dp_type)278 void btif_av_stream_start(const A2dpType local_a2dp_type) {
279 inc_func_call_count(__func__);
280 test::mock::btif_av::btif_av_stream_start(local_a2dp_type);
281 }
btif_av_stream_start_offload(void)282 void btif_av_stream_start_offload(void) {
283 inc_func_call_count(__func__);
284 test::mock::btif_av::btif_av_stream_start_offload();
285 }
btif_av_stream_start_with_latency(bool use_latency_mode)286 void btif_av_stream_start_with_latency(bool use_latency_mode) {
287 inc_func_call_count(__func__);
288 test::mock::btif_av::btif_av_stream_start_with_latency(use_latency_mode);
289 }
btif_av_stream_started_ready(const A2dpType local_a2dp_type)290 bool btif_av_stream_started_ready(const A2dpType local_a2dp_type) {
291 inc_func_call_count(__func__);
292 return test::mock::btif_av::btif_av_stream_started_ready(local_a2dp_type);
293 }
btif_av_stream_stop(const RawAddress & peer_address)294 void btif_av_stream_stop(const RawAddress& peer_address) {
295 inc_func_call_count(__func__);
296 test::mock::btif_av::btif_av_stream_stop(peer_address);
297 }
btif_av_stream_suspend(void)298 void btif_av_stream_suspend(void) {
299 inc_func_call_count(__func__);
300 test::mock::btif_av::btif_av_stream_suspend();
301 }
btif_debug_av_dump(int fd)302 void btif_debug_av_dump(int fd) {
303 inc_func_call_count(__func__);
304 test::mock::btif_av::btif_debug_av_dump(fd);
305 }
dump_av_sm_event_name(int event)306 const char* dump_av_sm_event_name(int event) {
307 inc_func_call_count(__func__);
308 return test::mock::btif_av::dump_av_sm_event_name(event);
309 }
310 // Mocked functions complete
311 // END mockcify generation
312