blob: 1da4e04c6f45e20b9ec185d1c9205cc67c4f97b1 [file] [log] [blame]
Bob Badour92ecf7c2021-02-12 18:05:29 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "system_bt_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["system_bt_license"],
8}
9
Jack He65b2a572016-12-07 18:25:17 -080010cc_defaults {
11 name: "fluoride_bta_defaults",
William Escandeae01e9b2022-03-10 12:48:12 +000012 defaults: ["fluoride_basic_defaults"],
Jack He65b2a572016-12-07 18:25:17 -080013 local_include_dirs: [
14 "include",
15 "sys",
16 "dm",
17 "hd",
18 "hh",
Jack He65b2a572016-12-07 18:25:17 -080019 ],
20 include_dirs: [
21 "packages/modules/Bluetooth/system",
22 "packages/modules/Bluetooth/system/bta/include",
Ajay Panicker0ad702c2018-03-16 17:13:50 -070023 "packages/modules/Bluetooth/system/btif/avrcp",
Jack He483217b2017-10-21 01:35:57 -070024 "packages/modules/Bluetooth/system/btif/include",
Chris Manton131f21c2021-06-08 17:38:06 -070025 "packages/modules/Bluetooth/system/gd",
Jakub Pawlowski9e9eb4b2017-10-17 16:40:41 -070026 "packages/modules/Bluetooth/system/internal_include",
Jack He65b2a572016-12-07 18:25:17 -080027 "packages/modules/Bluetooth/system/stack/include",
28 "packages/modules/Bluetooth/system/stack/btm",
29 "packages/modules/Bluetooth/system/udrv/include",
30 "packages/modules/Bluetooth/system/vnd/include",
31 "packages/modules/Bluetooth/system/utils/include",
Zach Johnson22761ec2020-12-21 18:14:30 -080032 "packages/modules/Bluetooth/system/gd/rust/shim",
Jack He65b2a572016-12-07 18:25:17 -080033 ],
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070034 header_libs: ["libbluetooth_headers"],
Jack He65b2a572016-12-07 18:25:17 -080035 cflags: ["-DBUILDCFG"],
36}
37
Chris Mantona9c16c82021-07-08 08:22:48 -070038filegroup {
39 name: "BtaDmSources",
40 srcs: [
41 "dm/bta_dm_act.cc",
42 "dm/bta_dm_api.cc",
43 "dm/bta_dm_cfg.cc",
44 "dm/bta_dm_ci.cc",
45 "dm/bta_dm_main.cc",
46 "dm/bta_dm_pm.cc",
47 ],
48}
49
Jack He65b2a572016-12-07 18:25:17 -080050// BTA static library for target
Jack He65b2a572016-12-07 18:25:17 -080051cc_library_static {
52 name: "libbt-bta",
53 defaults: ["fluoride_bta_defaults"],
54 srcs: [
Chris Mantona9c16c82021-07-08 08:22:48 -070055 ":BtaDmSources",
Jack He65b2a572016-12-07 18:25:17 -080056 "ag/bta_ag_act.cc",
57 "ag/bta_ag_api.cc",
58 "ag/bta_ag_at.cc",
59 "ag/bta_ag_cfg.cc",
Jack He65b2a572016-12-07 18:25:17 -080060 "ag/bta_ag_cmd.cc",
61 "ag/bta_ag_main.cc",
62 "ag/bta_ag_rfc.cc",
63 "ag/bta_ag_sco.cc",
64 "ag/bta_ag_sdp.cc",
65 "ar/bta_ar.cc",
66 "av/bta_av_aact.cc",
67 "av/bta_av_act.cc",
68 "av/bta_av_api.cc",
69 "av/bta_av_cfg.cc",
70 "av/bta_av_ci.cc",
71 "av/bta_av_main.cc",
72 "av/bta_av_ssm.cc",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +000073 "csis/csis_client.cc",
Jack He65b2a572016-12-07 18:25:17 -080074 "gatt/bta_gattc_act.cc",
75 "gatt/bta_gattc_api.cc",
76 "gatt/bta_gattc_cache.cc",
Jakub Pawlowski1ed87e92022-04-08 15:54:13 +020077 "gatt/bta_gattc_db_storage.cc",
Jack He65b2a572016-12-07 18:25:17 -080078 "gatt/bta_gattc_main.cc",
Jakub Pawlowski19d0aae2017-11-29 21:49:32 -080079 "gatt/bta_gattc_queue.cc",
Jack He65b2a572016-12-07 18:25:17 -080080 "gatt/bta_gattc_utils.cc",
81 "gatt/bta_gatts_act.cc",
82 "gatt/bta_gatts_api.cc",
83 "gatt/bta_gatts_main.cc",
sravan voleti898c0632022-03-10 09:00:24 +010084 "gatt/bta_gatts_queue.cc",
Jack He65b2a572016-12-07 18:25:17 -080085 "gatt/bta_gatts_utils.cc",
Jakub Pawlowski6d3cb112018-04-18 07:31:30 -070086 "gatt/database.cc",
87 "gatt/database_builder.cc",
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +000088 "groups/groups.cc",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +000089 "vc/device.cc",
90 "vc/vc.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +010091 "le_audio/broadcaster/broadcaster.cc",
92 "le_audio/broadcaster/broadcaster_types.cc",
93 "le_audio/broadcaster/state_machine.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +000094 "le_audio/client.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +080095 "le_audio/codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +000096 "le_audio/devices.cc",
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -070097 "le_audio/hal_verifier.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +000098 "le_audio/state_machine.cc",
99 "le_audio/client_parser.cc",
100 "le_audio/client_audio.cc",
Jakub Tyszkowskie82b5122022-01-18 18:38:06 +0000101 "le_audio/le_audio_set_configuration_provider.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000102 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000103 "le_audio/le_audio_types.cc",
Josh Wuc033a162022-05-05 01:29:04 -0700104 "le_audio/metrics_collector.cc",
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000105 "has/has_client.cc",
106 "has/has_ctp.cc",
107 "has/has_journal.cc",
108 "has/has_preset.cc",
109 "has/has_types.cc",
Jakub Pawlowski7d06e572018-02-28 22:44:42 -0800110 "hearing_aid/hearing_aid.cc",
Hansong Zhangd19e0272018-01-19 12:23:57 -0800111 "hearing_aid/hearing_aid_audio_source.cc",
Jack He65b2a572016-12-07 18:25:17 -0800112 "hf_client/bta_hf_client_act.cc",
113 "hf_client/bta_hf_client_api.cc",
114 "hf_client/bta_hf_client_at.cc",
115 "hf_client/bta_hf_client_main.cc",
116 "hf_client/bta_hf_client_rfc.cc",
117 "hf_client/bta_hf_client_sco.cc",
118 "hf_client/bta_hf_client_sdp.cc",
119 "hh/bta_hh_act.cc",
120 "hh/bta_hh_api.cc",
121 "hh/bta_hh_cfg.cc",
122 "hh/bta_hh_le.cc",
123 "hh/bta_hh_main.cc",
124 "hh/bta_hh_utils.cc",
Jack He65b2a572016-12-07 18:25:17 -0800125 "hd/bta_hd_act.cc",
126 "hd/bta_hd_api.cc",
127 "hd/bta_hd_main.cc",
128 "jv/bta_jv_act.cc",
129 "jv/bta_jv_api.cc",
130 "jv/bta_jv_cfg.cc",
Jack He65b2a572016-12-07 18:25:17 -0800131 "pan/bta_pan_act.cc",
132 "pan/bta_pan_api.cc",
133 "pan/bta_pan_ci.cc",
134 "pan/bta_pan_main.cc",
135 "sdp/bta_sdp.cc",
136 "sdp/bta_sdp_act.cc",
137 "sdp/bta_sdp_api.cc",
138 "sdp/bta_sdp_cfg.cc",
139 "sys/bta_sys_conn.cc",
140 "sys/bta_sys_main.cc",
141 "sys/utl.cc",
142 ],
Ajay Panicker0ad702c2018-03-16 17:13:50 -0700143 static_libs: [
144 "avrcp-target-service",
145 "lib-bt-packets",
146 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000147 generated_headers: [
148 "LeAudioSetConfigSchemas_h",
149 ],
Hansong Zhang777b6342021-02-23 15:52:11 -0800150 host_supported: true,
ahujapalash5add3d52022-03-10 18:38:02 +0000151 min_sdk_version: "Tiramisu"
Jack He65b2a572016-12-07 18:25:17 -0800152}
153
154// bta unit tests for target
Jack He65b2a572016-12-07 18:25:17 -0800155cc_test {
156 name: "net_test_bta",
157 defaults: ["fluoride_bta_defaults"],
Yanfei Zhoud2439812018-08-28 10:58:52 +0800158 test_suites: ["device-tests"],
Jack He65b2a572016-12-07 18:25:17 -0800159 srcs: [
Chris Manton8fe47512021-09-24 13:30:54 -0700160 ":TestMockStackBtm",
161 ":TestCommonMockFunctions",
Jack He65b2a572016-12-07 18:25:17 -0800162 "test/bta_hf_client_test.cc",
Yanfei Zhoud2439812018-08-28 10:58:52 +0800163 "test/bta_dm_cust_uuid_test.cc",
Fei Zhenga6d4be12019-12-25 10:45:51 +0800164 "test/bta_dip_test.cc",
Jakub Pawlowski6d3cb112018-04-18 07:31:30 -0700165 "test/gatt/database_builder_test.cc",
166 "test/gatt/database_builder_sample_device_test.cc",
167 "test/gatt/database_test.cc",
Jack He65b2a572016-12-07 18:25:17 -0800168 ],
169 shared_libs: [
William Escandeae01e9b2022-03-10 12:48:12 +0000170 "android.hardware.bluetooth.audio@2.0",
171 "android.hardware.bluetooth.audio@2.1",
Hansong Zhang8bb04bb2018-12-12 14:52:00 -0800172 "libcrypto",
Jack He65b2a572016-12-07 18:25:17 -0800173 "liblog",
174 "libprotobuf-cpp-lite",
175 ],
176 static_libs: [
HsingYuan Lo2d3da482020-08-18 09:30:32 +0200177 "crypto_toolbox_for_tests",
Jack He65b2a572016-12-07 18:25:17 -0800178 "libbtcore",
179 "libbt-bta",
Cheney Ni895430b2018-12-12 20:20:28 +0800180 "libbt-audio-hal-interface",
Jakub Pawlowskif9f45852017-07-03 15:39:36 -0700181 "libbluetooth-types",
Jack He9a30a9f2018-03-03 00:03:25 -0800182 "libbt-protos-lite",
Jack He65b2a572016-12-07 18:25:17 -0800183 "libosi",
Jack He42823982018-08-15 12:38:37 -0700184 "libbt-common",
Jack He65b2a572016-12-07 18:25:17 -0800185 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000186 data: [
187 ":audio_set_scenarios_bfbs",
188 ":audio_set_scenarios_json",
189 ":audio_set_configurations_bfbs",
190 ":audio_set_configurations_json",
191 ],
Jack He65b2a572016-12-07 18:25:17 -0800192}
Song Gaoe2253a52019-12-10 10:36:17 +0800193
Chris Manton445082d2021-02-07 20:26:22 -0800194cc_test {
195 name: "bt_host_test_bta",
196 defaults: ["fluoride_bta_defaults"],
197 test_suites: ["device-tests"],
198 host_supported: true,
199 include_dirs: [
200 "packages/modules/Bluetooth/system",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700201 "packages/modules/Bluetooth/system/gd",
202 ],
203 generated_headers: [
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700204 "BluetoothGeneratedDumpsysDataSchema_h",
205 "BluetoothGeneratedPackets_h",
Chris Manton445082d2021-02-07 20:26:22 -0800206 ],
207 srcs: [
Chris Manton29deec22021-07-14 10:03:54 -0700208 ":OsiCompatSources",
Chris Manton847dc382021-05-12 10:08:48 -0700209 ":TestCommonMainHandler",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700210 ":TestMockBtif",
211 ":TestMockDevice",
212 ":TestMockMainShim",
Chris Manton29deec22021-07-14 10:03:54 -0700213 ":TestMockOsi",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700214 ":TestMockStack",
Chris Manton866c5da2021-07-15 22:21:18 -0700215 "ar/bta_ar.cc",
216 "dm/bta_dm_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800217 "dm/bta_dm_act.cc",
218 "dm/bta_dm_cfg.cc",
219 "dm/bta_dm_ci.cc",
220 "dm/bta_dm_main.cc",
221 "dm/bta_dm_pm.cc",
222 "gatt/bta_gattc_act.cc",
223 "gatt/bta_gattc_api.cc",
224 "gatt/bta_gattc_cache.cc",
Jakub Pawlowski1ed87e92022-04-08 15:54:13 +0200225 "gatt/bta_gattc_db_storage.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800226 "gatt/bta_gattc_main.cc",
227 "gatt/bta_gattc_queue.cc",
228 "gatt/bta_gattc_utils.cc",
229 "gatt/database.cc",
230 "gatt/database_builder.cc",
231 "hh/bta_hh_act.cc",
Chris Manton847dc382021-05-12 10:08:48 -0700232 "hh/bta_hh_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800233 "hh/bta_hh_cfg.cc",
234 "hh/bta_hh_le.cc",
235 "hh/bta_hh_main.cc",
236 "hh/bta_hh_utils.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700237 "pan/bta_pan_act.cc",
238 "pan/bta_pan_api.cc",
239 "pan/bta_pan_main.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800240 "sys/bta_sys_conn.cc",
241 "sys/bta_sys_main.cc",
242 "test/bta_dm_test.cc",
Chris Manton607b8c02021-05-07 09:45:55 -0700243 "test/bta_gatt_test.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700244 "test/bta_pan_test.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800245 ],
246 shared_libs: [
Yi Kong2fb33f82021-12-16 02:46:09 +0800247 "libbase",
Chris Manton445082d2021-02-07 20:26:22 -0800248 "libcrypto",
249 "liblog",
250 "libprotobuf-cpp-lite",
251 ],
252 static_libs: [
253 "libbluetooth-types",
254 "libbt-common",
255 "libbt-protos-lite",
256 "libbtcore",
William Escandeae01e9b2022-03-10 12:48:12 +0000257 "libflatbuffers-cpp",
Chris Manton445082d2021-02-07 20:26:22 -0800258 "libgmock",
259 ],
Chris Manton29deec22021-07-14 10:03:54 -0700260 sanitize: {
261 address: true,
262 cfi: true,
263 misc_undefined: ["bounds"],
264 },
Chris Manton445082d2021-02-07 20:26:22 -0800265}
266
Song Gaoe2253a52019-12-10 10:36:17 +0800267// bta hf client add record tests for target
Song Gaoe2253a52019-12-10 10:36:17 +0800268cc_test {
269 name: "net_test_hf_client_add_record",
270 defaults: ["fluoride_defaults"],
271 test_suites: ["device-tests"],
272 include_dirs: [
273 "packages/modules/Bluetooth/system",
Chris Manton131f21c2021-06-08 17:38:06 -0700274 "packages/modules/Bluetooth/system/gd",
Song Gaoe2253a52019-12-10 10:36:17 +0800275 "packages/modules/Bluetooth/system/bta/include",
276 "packages/modules/Bluetooth/system/bta/sys",
277 "packages/modules/Bluetooth/system/btif/include",
278 "packages/modules/Bluetooth/system/internal_include",
279 "packages/modules/Bluetooth/system/stack/include",
280 "packages/modules/Bluetooth/system/utils/include",
281 ],
282 srcs: [
283 "test/bta_hf_client_add_record_test.cc",
284 ],
285 header_libs: ["libbluetooth_headers"],
286 shared_libs: [
287 "libcutils",
288 "liblog",
289 ],
290 static_libs: [
291 "libbluetooth-types",
292 "libosi",
293 ],
294 cflags: ["-DBUILDCFG"],
295}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000296
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000297// csis unit tests for host
298cc_test {
299 name: "bluetooth_csis_test",
300 test_suites: ["device-tests"],
301 defaults: [
302 "fluoride_bta_defaults",
303 "clang_coverage_bin",
304 ],
305 host_supported: true,
306 include_dirs: [
307 "packages/modules/Bluetooth/system",
308 "packages/modules/Bluetooth/system/bta/groups",
309 "packages/modules/Bluetooth/system/bta/include",
310 "packages/modules/Bluetooth/system/bta/test/common",
311 "packages/modules/Bluetooth/system/btif/include",
312 "packages/modules/Bluetooth/system/osi/include",
313 ],
314 srcs : [
315 ":TestMockBtif",
Chienyuan9c8568e2021-11-15 20:01:15 +0800316 ":TestMockMainShimLeScanning",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000317 "csis/csis_client.cc",
318 "csis/csis_client_test.cc",
319 "groups/groups.cc",
320 "gatt/database.cc",
321 "gatt/database_builder.cc",
322 "test/common/bta_dm_api_mock.cc",
323 "test/common/bta_gatt_api_mock.cc",
324 "test/common/bta_gatt_queue_mock.cc",
325 "test/common/btm_api_mock.cc",
326 ],
327 shared_libs: [
328 "libprotobuf-cpp-lite",
329 "libcrypto",
330 ],
331 static_libs : [
332 "crypto_toolbox_for_tests",
333 "libgmock",
334 "libbt-common",
335 "libbt-protos-lite",
336 "libosi",
337 ],
338 sanitize: {
339 cfi: true,
340 scs: true,
341 address: true,
342 all_undefined: true,
343 integer_overflow: true,
344 diag: {
345 undefined : true
346 },
347 },
348}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000349
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +0000350// groups unit tests for host
351cc_test {
352 name: "bluetooth_groups_test",
353 test_suites: ["device-tests"],
354 defaults: [
355 "fluoride_bta_defaults",
356 "clang_coverage_bin",
357 ],
358 host_supported: true,
359 include_dirs: [
360 "packages/modules/Bluetooth/system",
361 "packages/modules/Bluetooth/system/bta/include",
362 ],
363 srcs : [
364 ":TestMockBtif",
365 "groups/groups_test.cc",
366 "groups/groups.cc",
367 ],
368 shared_libs: [
369 "libprotobuf-cpp-lite",
370 "libcrypto",
371 ],
372 static_libs : [
373 "crypto_toolbox_for_tests",
374 "libgmock",
375 "libbt-common",
376 "libbt-protos-lite",
377 "libosi",
378 ],
379 sanitize: {
380 cfi: true,
381 scs: true,
382 address: true,
383 all_undefined: true,
384 integer_overflow: true,
385 diag: {
386 undefined : true
387 },
388 },
389}
390
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000391// bta unit tests for host
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000392cc_test {
393 name: "bluetooth_vc_test",
394 test_suites: ["device-tests"],
395 defaults: [
396 "fluoride_bta_defaults",
397 "clang_coverage_bin",
398 ],
399 host_supported: true,
400 include_dirs: [
401 "packages/modules/Bluetooth/system",
402 "packages/modules/Bluetooth/system/bta/include",
403 "packages/modules/Bluetooth/system/bta/test/common",
Łukasz Rymanowski9f3756e2022-05-06 11:59:36 +0000404 "packages/modules/Bluetooth/system/gd",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000405 "packages/modules/Bluetooth/system/stack/include",
406 ],
407 srcs : [
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000408 ":TestMockOsi",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000409 "gatt/database.cc",
410 "gatt/database_builder.cc",
411 "test/common/bta_gatt_api_mock.cc",
412 "test/common/bta_gatt_queue_mock.cc",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000413 "test/common/mock_csis_client.cc",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000414 "test/common/btm_api_mock.cc",
415 "vc/devices_test.cc",
416 "vc/device.cc",
417 "vc/vc.cc",
418 "vc/vc_test.cc",
419 ],
420 shared_libs: [
421 "libprotobuf-cpp-lite",
422 "libcrypto",
423 ],
424 static_libs : [
425 "crypto_toolbox_for_tests",
426 "libgmock",
427 "libbt-common",
428 "libbt-protos-lite",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000429 "libosi"
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000430 ],
431 sanitize: {
432 cfi: false,
433 },
434}
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000435
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000436genrule {
437 name: "LeAudioSetConfigSchemas_h",
438 tools: [
439 "flatc",
440 ],
441 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -o $(genDir) --cpp $(in) ",
442 srcs: [
443 "le_audio/audio_set_configurations.fbs",
444 "le_audio/audio_set_scenarios.fbs",
445 ],
446 out: [
447 "audio_set_configurations_generated.h",
448 "audio_set_scenarios_generated.h",
449 ],
450}
451
452genrule {
453 name: "LeAudioSetScenariosSchema_bfbs",
454 tools: [
455 "flatc",
456 ],
457 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
458 srcs: [
459 "le_audio/audio_set_scenarios.fbs",
460 ],
461 out: [
462 "audio_set_scenarios.bfbs",
463 ],
464}
465
466genrule {
467 name: "LeAudioSetConfigsSchema_bfbs",
468 tools: [
469 "flatc",
470 ],
471 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
472 srcs: [
473 "le_audio/audio_set_configurations.fbs",
474 ],
475 out: [
476 "audio_set_configurations.bfbs",
477 ],
478}
479
480prebuilt_etc {
481 name: "audio_set_scenarios_bfbs",
482 src: ":LeAudioSetScenariosSchema_bfbs",
483 filename: "audio_set_scenarios.bfbs",
484 sub_dir: "bluetooth/le_audio",
485}
486
487prebuilt_etc {
488 name: "audio_set_scenarios_json",
489 src: "le_audio/audio_set_scenarios.json",
490 filename_from_src: true,
491 sub_dir: "bluetooth/le_audio",
492}
493
494prebuilt_etc {
495 name: "audio_set_configurations_bfbs",
496 src: ":LeAudioSetConfigsSchema_bfbs",
497 filename: "audio_set_configurations.bfbs",
498 sub_dir: "bluetooth/le_audio",
499}
500
501prebuilt_etc {
502 name: "audio_set_configurations_json",
503 src: "le_audio/audio_set_configurations.json",
504 filename_from_src: true,
505 sub_dir: "bluetooth/le_audio",
506}
507
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000508// bta unit tests for LE Audio
509// ========================================================
510cc_test {
511 name: "bluetooth_le_audio_test",
512 test_suites: ["device-tests"],
513 defaults: [
514 "fluoride_defaults",
515 "clang_coverage_bin",
516 ],
517 host_supported: true,
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000518 target: {
519 darwin: {
520 enabled: false,
521 },
522 android: {
523 cflags: [
524 "-DOS_ANDROID",
525 ],
526 sanitize: {
527 misc_undefined: ["bounds"],
528 },
529 },
530 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000531 include_dirs: [
532 "packages/modules/Bluetooth/system",
533 "packages/modules/Bluetooth/system/bta/include",
534 "packages/modules/Bluetooth/system/bta/test/common",
535 "packages/modules/Bluetooth/system/btif/include",
536 "packages/modules/Bluetooth/system/gd",
537 "packages/modules/Bluetooth/system/stack/include",
538 ],
539 srcs : [
540 ":TestStubOsi",
Alice Kuo422f55d2021-12-30 11:33:32 +0800541 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000542 "test/common/bta_gatt_api_mock.cc",
543 "test/common/bta_gatt_queue_mock.cc",
544 "test/common/btm_api_mock.cc",
545 "le_audio/client_audio.cc",
546 "le_audio/client_audio_test.cc",
547 "le_audio/client_parser.cc",
548 "le_audio/client_parser_test.cc",
549 "le_audio/devices.cc",
550 "le_audio/devices_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000551 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000552 "le_audio/le_audio_types.cc",
553 "le_audio/le_audio_types_test.cc",
Josh Wuc033a162022-05-05 01:29:04 -0700554 "le_audio/metrics_collector_linux.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000555 "le_audio/mock_iso_manager.cc",
556 "test/common/mock_controller.cc",
557 "le_audio/state_machine.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800558 "le_audio/state_machine_test.cc",
559 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000560 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000561 data: [
562 ":audio_set_scenarios_bfbs",
563 ":audio_set_scenarios_json",
564 ":audio_set_configurations_bfbs",
565 ":audio_set_configurations_json"
566 ],
567 generated_headers: [
568 "LeAudioSetConfigSchemas_h",
569 ],
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000570 shared_libs: [
571 "libprotobuf-cpp-lite",
572 "libcrypto",
573 "liblog", // __android_log_print
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000574 "android.hardware.bluetooth.audio@2.0",
575 "android.hardware.bluetooth.audio@2.1",
576 "libhidlbase",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000577 ],
578 static_libs : [
579 "libgmock",
580 "libbt-common",
581 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000582 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000583 "libosi",
584 ],
585 sanitize: {
586 cfi: false,
587 },
588}
589
590cc_test {
591 name: "bluetooth_le_audio_client_test",
592 test_suites: ["device-tests"],
593 defaults: [
594 "fluoride_bta_defaults",
595 "clang_coverage_bin",
596 ],
597 host_supported: true,
598 include_dirs: [
599 "packages/modules/Bluetooth/system",
600 "packages/modules/Bluetooth/system/bta/include",
601 "packages/modules/Bluetooth/system/bta/test/common",
602 "packages/modules/Bluetooth/system/stack/include",
603 ],
604 srcs : [
Łukasz Rymanowskiaf2d9512022-01-20 22:23:14 +0000605 ":TestStubOsi",
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700606 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000607 "gatt/database.cc",
608 "gatt/database_builder.cc",
609 "le_audio/client.cc",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000610 "le_audio/client_audio.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000611 "le_audio/client_parser.cc",
612 "le_audio/devices.cc",
613 "le_audio/le_audio_client_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000614 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000615 "le_audio/le_audio_types.cc",
Josh Wuc033a162022-05-05 01:29:04 -0700616 "le_audio/metrics_collector.cc",
617 "le_audio/metrics_collector_test.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000618 "le_audio/mock_iso_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000619 "le_audio/mock_state_machine.cc",
620 "test/common/btm_api_mock.cc",
621 "test/common/bta_gatt_api_mock.cc",
622 "test/common/bta_gatt_queue_mock.cc",
623 "test/common/btif_storage_mock.cc",
624 "test/common/mock_csis_client.cc",
625 "test/common/mock_controller.cc",
626 "test/common/mock_device_groups.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800627 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000628 ],
629 shared_libs: [
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700630 "android.hardware.bluetooth.audio@2.0",
631 "android.hardware.bluetooth.audio@2.1",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000632 "libhidlbase",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000633 "libprotobuf-cpp-lite",
634 "libcrypto",
635 "liblog",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000636 "libfmq",
637 "libbinder_ndk",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000638 ],
639 static_libs : [
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000640 "libbt-audio-hal-interface",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000641 "crypto_toolbox_for_tests",
642 "libgmock",
643 "libbt-common",
644 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000645 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000646 "libosi",
Jakub Pawlowskid0a41af2022-01-03 17:53:02 +0100647 "liblc3",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000648 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000649 data: [
650 ":audio_set_scenarios_bfbs",
651 ":audio_set_scenarios_json",
652 ":audio_set_configurations_bfbs",
653 ":audio_set_configurations_json",
654 ],
655 generated_headers: [
656 "LeAudioSetConfigSchemas_h",
657 ],
Josh Wu28d6da12021-12-22 06:13:40 -0800658 target: {
659 android: {
660 shared_libs: [
661 "libbinder_ndk",
Omer Osman066fa552022-05-01 03:22:13 +0000662 "android.hardware.bluetooth.audio-V2-ndk",
Josh Wu28d6da12021-12-22 06:13:40 -0800663 ],
664 },
665 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000666 sanitize: {
667 cfi: true,
668 scs: true,
669 address: true,
670 all_undefined: true,
671 integer_overflow: true,
672 diag: {
673 undefined : true
674 },
675 },
676}
677
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100678cc_test {
679 name: "bluetooth_test_broadcaster_sm",
680 test_suites: ["device-tests"],
681 defaults: [
682 "fluoride_bta_defaults",
683 "clang_coverage_bin",
684 ],
685 host_supported: true,
686 include_dirs: [
687 "packages/modules/Bluetooth/system",
688 "packages/modules/Bluetooth/system/bta/include",
689 "packages/modules/Bluetooth/system/bta/le_audio",
690 "packages/modules/Bluetooth/system/btif/include",
691 "packages/modules/Bluetooth/system/stack/include",
692 "packages/modules/Bluetooth/system/stack/btm",
693 ],
694 srcs : [
695 "le_audio/broadcaster/broadcaster_types.cc",
696 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
697 "le_audio/broadcaster/state_machine.cc",
698 "le_audio/broadcaster/state_machine_test.cc",
699 "le_audio/le_audio_types.cc",
700 "le_audio/mock_iso_manager.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800701 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100702 ],
703 shared_libs: [
704 "libprotobuf-cpp-lite",
705 "libcrypto",
706 ],
707 static_libs : [
708 "libgmock",
709 "libbt-common",
710 "libbt-protos-lite",
711 "liblc3",
712 ],
713 sanitize: {
714 cfi: true,
715 scs: true,
716 address: true,
717 all_undefined: true,
718 integer_overflow: true,
719 diag: {
720 undefined : true
721 },
722 },
723}
724
725cc_test {
726 name: "bluetooth_test_broadcaster",
727 test_suites: ["device-tests"],
728 defaults: [
729 "fluoride_bta_defaults",
730 "clang_coverage_bin",
731 ],
732 host_supported: true,
733 include_dirs: [
734 "packages/modules/Bluetooth/system",
735 "packages/modules/Bluetooth/system/bta/include",
736 "packages/modules/Bluetooth/system/bta/le_audio",
737 "packages/modules/Bluetooth/system/bta/test/common",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100738 "packages/modules/Bluetooth/system/btif/include",
739 "packages/modules/Bluetooth/system/stack/include",
740 "packages/modules/Bluetooth/system/stack/btm",
741 ],
742 srcs : [
743 ":TestStubOsi",
744 "le_audio/broadcaster/broadcaster.cc",
745 "le_audio/broadcaster/broadcaster_test.cc",
746 "le_audio/broadcaster/broadcaster_types.cc",
747 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
748 "le_audio/broadcaster/mock_state_machine.cc",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000749 "le_audio/client_audio.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100750 "le_audio/le_audio_types.cc",
751 "le_audio/mock_iso_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100752 "test/common/mock_controller.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800753 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100754 ],
755 shared_libs: [
756 "libprotobuf-cpp-lite",
757 "libcrypto",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000758 "libfmq",
759 "libbinder_ndk",
760 "android.hardware.bluetooth.audio@2.0",
761 "android.hardware.bluetooth.audio@2.1",
762 "libhidlbase",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100763 ],
764 static_libs : [
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000765 "libbt-audio-hal-interface",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100766 "libgmock",
767 "libbt-common",
768 "libbt-protos-lite",
769 "libosi",
770 "liblc3",
771 ],
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000772 target: {
773 android: {
774 shared_libs: [
775 "libbinder_ndk",
Omer Osman066fa552022-05-01 03:22:13 +0000776 "android.hardware.bluetooth.audio-V2-ndk",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000777 ],
778 },
779 },
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100780 sanitize: {
781 cfi: true,
782 scs: true,
783 address: true,
784 all_undefined: true,
785 integer_overflow: true,
786 diag: {
787 undefined : true
788 },
789 },
790}
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000791
792cc_test {
793 name: "bluetooth_has_test",
794 test_suites: ["device-tests"],
795 defaults: [
796 "fluoride_bta_defaults",
797 "clang_coverage_bin",
798 ],
799 host_supported: true,
800 include_dirs: [
801 "packages/modules/Bluetooth/system",
802 "packages/modules/Bluetooth/system/bta/include",
803 "packages/modules/Bluetooth/system/bta/test/common",
804 "packages/modules/Bluetooth/system/stack/include",
805 ],
806 srcs : [
807 "gatt/database.cc",
808 "gatt/database_builder.cc",
809 "has/has_client.cc",
810 "has/has_client_test.cc",
811 "has/has_ctp.cc",
812 "has/has_journal.cc",
813 "has/has_preset.cc",
814 "has/has_types.cc",
815 "test/common/bta_gatt_api_mock.cc",
816 "test/common/bta_gatt_queue_mock.cc",
817 "test/common/btif_storage_mock.cc",
818 "test/common/btm_api_mock.cc",
819 "test/common/mock_controller.cc",
820 "test/common/mock_csis_client.cc",
821 ],
822 shared_libs: [
823 "libprotobuf-cpp-lite",
824 "libcrypto",
825 ],
826 static_libs : [
827 "crypto_toolbox_for_tests",
828 "libgmock",
829 "libbt-common",
830 "libbt-protos-lite",
831 ],
832 sanitize: {
833 cfi: true,
834 scs: true,
835 address: true,
836 all_undefined: true,
837 integer_overflow: true,
838 diag: {
839 undefined : true
840 },
841 },
ahujapalash5add3d52022-03-10 18:38:02 +0000842}