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 // TODO(b/369381361) Enfore -Wmissing-prototypes
36 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
37
38 namespace test {
39 namespace mock {
40 namespace btif_av {
41
42 // Function state capture and return values, if needed
43 struct btif_av_acl_disconnected btif_av_acl_disconnected;
44 struct btif_av_clear_remote_suspend_flag btif_av_clear_remote_suspend_flag;
45 struct btif_av_find_by_handle btif_av_find_by_handle;
46 struct btif_av_get_audio_delay btif_av_get_audio_delay;
47 struct btif_av_get_peer_sep btif_av_get_peer_sep;
48 struct btif_av_is_a2dp_offload_enabled btif_av_is_a2dp_offload_enabled;
49 struct btif_av_is_a2dp_offload_running btif_av_is_a2dp_offload_running;
50 struct btif_av_is_connected btif_av_is_connected;
51 struct btif_av_is_connected_addr btif_av_is_connected_addr;
52 struct btif_av_is_peer_edr btif_av_is_peer_edr;
53 struct btif_av_is_peer_silenced btif_av_is_peer_silenced;
54 struct btif_av_is_sink_enabled btif_av_is_sink_enabled;
55 struct btif_av_is_source_enabled btif_av_is_source_enabled;
56 struct btif_av_peer_is_connected_sink btif_av_peer_is_connected_sink;
57 struct btif_av_peer_is_connected_source btif_av_peer_is_connected_source;
58 struct btif_av_peer_is_sink btif_av_peer_is_sink;
59 struct btif_av_peer_is_source btif_av_peer_is_source;
60 struct btif_av_peer_prefers_mandatory_codec 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_set_audio_delay btif_av_set_audio_delay;
64 struct btif_av_set_dynamic_audio_buffer_size btif_av_set_dynamic_audio_buffer_size;
65 struct btif_av_set_low_latency btif_av_set_low_latency;
66 struct btif_av_sink_active_peer btif_av_sink_active_peer;
67 struct btif_av_sink_execute_service btif_av_sink_execute_service;
68 struct btif_av_source_active_peer btif_av_source_active_peer;
69 struct btif_av_source_execute_service btif_av_source_execute_service;
70 struct btif_av_src_sink_coexist_enabled btif_av_src_sink_coexist_enabled;
71 struct btif_av_stream_ready btif_av_stream_ready;
72 struct btif_av_stream_start btif_av_stream_start;
73 struct btif_av_stream_start_offload btif_av_stream_start_offload;
74 struct btif_av_stream_start_with_latency btif_av_stream_start_with_latency;
75 struct btif_av_stream_started_ready btif_av_stream_started_ready;
76 struct btif_av_stream_stop btif_av_stream_stop;
77 struct btif_av_stream_suspend btif_av_stream_suspend;
78 struct btif_debug_av_dump btif_debug_av_dump;
79
80 } // namespace btif_av
81 } // namespace mock
82 } // namespace test
83
84 // Mocked function return values, if any
85 namespace test {
86 namespace mock {
87 namespace btif_av {
88
89 const RawAddress& btif_av_find_by_handle::return_value = RawAddress::kEmpty;
90 uint16_t btif_av_get_audio_delay::return_value = 0;
91 uint8_t btif_av_get_peer_sep::return_value = 0;
92 bool btif_av_is_a2dp_offload_enabled::return_value = false;
93 bool btif_av_is_a2dp_offload_running::return_value = false;
94 bool btif_av_is_connected::return_value = false;
95 bool btif_av_is_connected_addr::return_value = false;
96 bool btif_av_is_peer_edr::return_value = false;
97 bool btif_av_is_peer_silenced::return_value = false;
98 bool btif_av_is_sink_enabled::return_value = false;
99 bool btif_av_is_source_enabled::return_value = false;
100 bool btif_av_peer_is_connected_sink::return_value = false;
101 bool btif_av_peer_is_connected_source::return_value = false;
102 bool btif_av_peer_is_sink::return_value = false;
103 bool btif_av_peer_is_source::return_value = false;
104 bool btif_av_peer_prefers_mandatory_codec::return_value = false;
105 bool btif_av_peer_supports_3mbps::return_value = false;
106 RawAddress btif_av_sink_active_peer::return_value;
107 bt_status_t btif_av_sink_execute_service::return_value = BT_STATUS_SUCCESS;
108 RawAddress btif_av_source_active_peer::return_value;
109 bt_status_t btif_av_source_execute_service::return_value = BT_STATUS_SUCCESS;
110 bool btif_av_src_sink_coexist_enabled::return_value = false;
111 bool btif_av_stream_ready::return_value = false;
112 bool btif_av_stream_started_ready::return_value = false;
113
114 } // namespace btif_av
115 } // namespace mock
116 } // namespace test
117
118 // Mocked functions, if any
btif_av_acl_disconnected(const RawAddress & peer_address,const A2dpType local_a2dp_type)119 void btif_av_acl_disconnected(const RawAddress& peer_address, const A2dpType local_a2dp_type) {
120 inc_func_call_count(__func__);
121 test::mock::btif_av::btif_av_acl_disconnected(peer_address, local_a2dp_type);
122 }
btif_av_clear_remote_suspend_flag(const A2dpType local_a2dp_type)123 void btif_av_clear_remote_suspend_flag(const A2dpType local_a2dp_type) {
124 inc_func_call_count(__func__);
125 test::mock::btif_av::btif_av_clear_remote_suspend_flag(local_a2dp_type);
126 }
btif_av_find_by_handle(tBTA_AV_HNDL bta_handle)127 const RawAddress& btif_av_find_by_handle(tBTA_AV_HNDL bta_handle) {
128 inc_func_call_count(__func__);
129 return test::mock::btif_av::btif_av_find_by_handle(bta_handle);
130 }
btif_av_get_audio_delay(const A2dpType local_a2dp_type)131 uint16_t btif_av_get_audio_delay(const A2dpType local_a2dp_type) {
132 inc_func_call_count(__func__);
133 return test::mock::btif_av::btif_av_get_audio_delay(local_a2dp_type);
134 }
btif_av_get_peer_sep(const A2dpType local_a2dp_type)135 uint8_t btif_av_get_peer_sep(const A2dpType local_a2dp_type) {
136 inc_func_call_count(__func__);
137 return test::mock::btif_av::btif_av_get_peer_sep(local_a2dp_type);
138 }
btif_av_is_a2dp_offload_enabled()139 bool btif_av_is_a2dp_offload_enabled() {
140 inc_func_call_count(__func__);
141 return test::mock::btif_av::btif_av_is_a2dp_offload_enabled();
142 }
btif_av_is_a2dp_offload_running()143 bool btif_av_is_a2dp_offload_running() {
144 inc_func_call_count(__func__);
145 return test::mock::btif_av::btif_av_is_a2dp_offload_running();
146 }
btif_av_is_connected(const A2dpType local_a2dp_type)147 bool btif_av_is_connected(const A2dpType local_a2dp_type) {
148 inc_func_call_count(__func__);
149 return test::mock::btif_av::btif_av_is_connected(local_a2dp_type);
150 }
btif_av_is_connected_addr(const RawAddress & peer_address,const A2dpType local_a2dp_type)151 bool btif_av_is_connected_addr(const RawAddress& peer_address, const A2dpType local_a2dp_type) {
152 inc_func_call_count(__func__);
153 return test::mock::btif_av::btif_av_is_connected_addr(peer_address, local_a2dp_type);
154 }
btif_av_is_peer_edr(const RawAddress & peer_address,const A2dpType local_a2dp_type)155 bool btif_av_is_peer_edr(const RawAddress& peer_address, const A2dpType local_a2dp_type) {
156 inc_func_call_count(__func__);
157 return test::mock::btif_av::btif_av_is_peer_edr(peer_address, local_a2dp_type);
158 }
btif_av_is_peer_silenced(const RawAddress & peer_address)159 bool btif_av_is_peer_silenced(const RawAddress& peer_address) {
160 inc_func_call_count(__func__);
161 return test::mock::btif_av::btif_av_is_peer_silenced(peer_address);
162 }
btif_av_is_sink_enabled(void)163 bool btif_av_is_sink_enabled(void) {
164 inc_func_call_count(__func__);
165 return test::mock::btif_av::btif_av_is_sink_enabled();
166 }
btif_av_is_source_enabled(void)167 bool btif_av_is_source_enabled(void) {
168 inc_func_call_count(__func__);
169 return test::mock::btif_av::btif_av_is_source_enabled();
170 }
btif_av_peer_is_connected_sink(const RawAddress & peer_address)171 bool btif_av_peer_is_connected_sink(const RawAddress& peer_address) {
172 inc_func_call_count(__func__);
173 return test::mock::btif_av::btif_av_peer_is_connected_sink(peer_address);
174 }
btif_av_peer_is_connected_source(const RawAddress & peer_address)175 bool btif_av_peer_is_connected_source(const RawAddress& peer_address) {
176 inc_func_call_count(__func__);
177 return test::mock::btif_av::btif_av_peer_is_connected_source(peer_address);
178 }
btif_av_peer_is_sink(const RawAddress & peer_address)179 bool btif_av_peer_is_sink(const RawAddress& peer_address) {
180 inc_func_call_count(__func__);
181 return test::mock::btif_av::btif_av_peer_is_sink(peer_address);
182 }
btif_av_peer_is_source(const RawAddress & peer_address)183 bool btif_av_peer_is_source(const RawAddress& peer_address) {
184 inc_func_call_count(__func__);
185 return test::mock::btif_av::btif_av_peer_is_source(peer_address);
186 }
btif_av_peer_prefers_mandatory_codec(const RawAddress & peer_address,const A2dpType local_a2dp_type)187 bool btif_av_peer_prefers_mandatory_codec(const RawAddress& peer_address,
188 const A2dpType local_a2dp_type) {
189 inc_func_call_count(__func__);
190 return test::mock::btif_av::btif_av_peer_prefers_mandatory_codec(peer_address, local_a2dp_type);
191 }
btif_av_peer_supports_3mbps(const RawAddress & peer_address,const A2dpType local_a2dp_type)192 bool btif_av_peer_supports_3mbps(const RawAddress& peer_address, const A2dpType local_a2dp_type) {
193 inc_func_call_count(__func__);
194 return test::mock::btif_av::btif_av_peer_supports_3mbps(peer_address, local_a2dp_type);
195 }
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)196 void btif_av_report_source_codec_state(
197 const RawAddress& peer_address, const btav_a2dp_codec_config_t& codec_config,
198 const std::vector<btav_a2dp_codec_config_t>& codecs_local_capabilities,
199 const std::vector<btav_a2dp_codec_config_t>& codecs_selectable_capabilities) {
200 inc_func_call_count(__func__);
201 test::mock::btif_av::btif_av_report_source_codec_state(
202 peer_address, codec_config, codecs_local_capabilities, codecs_selectable_capabilities);
203 }
btif_av_set_audio_delay(const RawAddress & peer_address,uint16_t delay,const A2dpType local_a2dp_type)204 void btif_av_set_audio_delay(const RawAddress& peer_address, uint16_t delay,
205 const A2dpType local_a2dp_type) {
206 inc_func_call_count(__func__);
207 test::mock::btif_av::btif_av_set_audio_delay(peer_address, delay, local_a2dp_type);
208 }
btif_av_set_dynamic_audio_buffer_size(uint8_t dynamic_audio_buffer_size)209 void btif_av_set_dynamic_audio_buffer_size(uint8_t dynamic_audio_buffer_size) {
210 inc_func_call_count(__func__);
211 test::mock::btif_av::btif_av_set_dynamic_audio_buffer_size(dynamic_audio_buffer_size);
212 }
btif_av_set_low_latency(bool is_low_latency)213 void btif_av_set_low_latency(bool is_low_latency) {
214 inc_func_call_count(__func__);
215 test::mock::btif_av::btif_av_set_low_latency(is_low_latency);
216 }
btif_av_sink_active_peer(void)217 RawAddress btif_av_sink_active_peer(void) {
218 inc_func_call_count(__func__);
219 return test::mock::btif_av::btif_av_sink_active_peer();
220 }
btif_av_sink_execute_service(bool enable)221 bt_status_t btif_av_sink_execute_service(bool enable) {
222 inc_func_call_count(__func__);
223 return test::mock::btif_av::btif_av_sink_execute_service(enable);
224 }
btif_av_source_active_peer(void)225 RawAddress btif_av_source_active_peer(void) {
226 inc_func_call_count(__func__);
227 return test::mock::btif_av::btif_av_source_active_peer();
228 }
btif_av_source_execute_service(bool enable)229 bt_status_t btif_av_source_execute_service(bool enable) {
230 inc_func_call_count(__func__);
231 return test::mock::btif_av::btif_av_source_execute_service(enable);
232 }
btif_av_src_sink_coexist_enabled(void)233 bool btif_av_src_sink_coexist_enabled(void) {
234 inc_func_call_count(__func__);
235 return test::mock::btif_av::btif_av_src_sink_coexist_enabled();
236 }
btif_av_stream_ready(const A2dpType local_a2dp_type)237 bool btif_av_stream_ready(const A2dpType local_a2dp_type) {
238 inc_func_call_count(__func__);
239 return test::mock::btif_av::btif_av_stream_ready(local_a2dp_type);
240 }
btif_av_stream_start(const A2dpType local_a2dp_type)241 void btif_av_stream_start(const A2dpType local_a2dp_type) {
242 inc_func_call_count(__func__);
243 test::mock::btif_av::btif_av_stream_start(local_a2dp_type);
244 }
btif_av_stream_start_offload(void)245 void btif_av_stream_start_offload(void) {
246 inc_func_call_count(__func__);
247 test::mock::btif_av::btif_av_stream_start_offload();
248 }
btif_av_stream_start_with_latency(bool use_latency_mode)249 void btif_av_stream_start_with_latency(bool use_latency_mode) {
250 inc_func_call_count(__func__);
251 test::mock::btif_av::btif_av_stream_start_with_latency(use_latency_mode);
252 }
btif_av_stream_started_ready(const A2dpType local_a2dp_type)253 bool btif_av_stream_started_ready(const A2dpType local_a2dp_type) {
254 inc_func_call_count(__func__);
255 return test::mock::btif_av::btif_av_stream_started_ready(local_a2dp_type);
256 }
btif_av_stream_stop(const RawAddress & peer_address)257 void btif_av_stream_stop(const RawAddress& peer_address) {
258 inc_func_call_count(__func__);
259 test::mock::btif_av::btif_av_stream_stop(peer_address);
260 }
btif_av_stream_suspend(void)261 void btif_av_stream_suspend(void) {
262 inc_func_call_count(__func__);
263 test::mock::btif_av::btif_av_stream_suspend();
264 }
btif_debug_av_dump(int fd)265 void btif_debug_av_dump(int fd) {
266 inc_func_call_count(__func__);
267 test::mock::btif_av::btif_debug_av_dump(fd);
268 }
269 // Mocked functions complete
270 // END mockcify generation
271