blob: ff1d304cfd4022af5990bd05e7d5c35bd169eab6 [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",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000157 defaults: [
158 "fluoride_bta_defaults",
159 "mts_defaults"
160 ],
Yanfei Zhoud2439812018-08-28 10:58:52 +0800161 test_suites: ["device-tests"],
Jack He65b2a572016-12-07 18:25:17 -0800162 srcs: [
Chris Manton8fe47512021-09-24 13:30:54 -0700163 ":TestMockStackBtm",
164 ":TestCommonMockFunctions",
Jack He65b2a572016-12-07 18:25:17 -0800165 "test/bta_hf_client_test.cc",
Yanfei Zhoud2439812018-08-28 10:58:52 +0800166 "test/bta_dm_cust_uuid_test.cc",
Fei Zhenga6d4be12019-12-25 10:45:51 +0800167 "test/bta_dip_test.cc",
Jakub Pawlowski6d3cb112018-04-18 07:31:30 -0700168 "test/gatt/database_builder_test.cc",
169 "test/gatt/database_builder_sample_device_test.cc",
170 "test/gatt/database_test.cc",
Jack He65b2a572016-12-07 18:25:17 -0800171 ],
172 shared_libs: [
William Escandeae01e9b2022-03-10 12:48:12 +0000173 "android.hardware.bluetooth.audio@2.0",
174 "android.hardware.bluetooth.audio@2.1",
Hansong Zhang8bb04bb2018-12-12 14:52:00 -0800175 "libcrypto",
Jack He65b2a572016-12-07 18:25:17 -0800176 "liblog",
177 "libprotobuf-cpp-lite",
178 ],
179 static_libs: [
HsingYuan Lo2d3da482020-08-18 09:30:32 +0200180 "crypto_toolbox_for_tests",
Jack He65b2a572016-12-07 18:25:17 -0800181 "libbtcore",
182 "libbt-bta",
Cheney Ni895430b2018-12-12 20:20:28 +0800183 "libbt-audio-hal-interface",
Jakub Pawlowskif9f45852017-07-03 15:39:36 -0700184 "libbluetooth-types",
Jack He9a30a9f2018-03-03 00:03:25 -0800185 "libbt-protos-lite",
Jack He65b2a572016-12-07 18:25:17 -0800186 "libosi",
Jack He42823982018-08-15 12:38:37 -0700187 "libbt-common",
Jack He65b2a572016-12-07 18:25:17 -0800188 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000189 data: [
190 ":audio_set_scenarios_bfbs",
191 ":audio_set_scenarios_json",
192 ":audio_set_configurations_bfbs",
193 ":audio_set_configurations_json",
194 ],
Jack He65b2a572016-12-07 18:25:17 -0800195}
Song Gaoe2253a52019-12-10 10:36:17 +0800196
Chris Manton445082d2021-02-07 20:26:22 -0800197cc_test {
198 name: "bt_host_test_bta",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000199 defaults: [
200 "fluoride_bta_defaults",
201 "mts_defaults",
202 ],
Chris Manton445082d2021-02-07 20:26:22 -0800203 test_suites: ["device-tests"],
204 host_supported: true,
205 include_dirs: [
206 "packages/modules/Bluetooth/system",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700207 "packages/modules/Bluetooth/system/gd",
208 ],
209 generated_headers: [
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700210 "BluetoothGeneratedDumpsysDataSchema_h",
211 "BluetoothGeneratedPackets_h",
Chris Manton445082d2021-02-07 20:26:22 -0800212 ],
213 srcs: [
Chris Manton29deec22021-07-14 10:03:54 -0700214 ":OsiCompatSources",
Chris Manton847dc382021-05-12 10:08:48 -0700215 ":TestCommonMainHandler",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700216 ":TestMockBtif",
217 ":TestMockDevice",
218 ":TestMockMainShim",
Chris Manton29deec22021-07-14 10:03:54 -0700219 ":TestMockOsi",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700220 ":TestMockStack",
Chris Manton866c5da2021-07-15 22:21:18 -0700221 "ar/bta_ar.cc",
222 "dm/bta_dm_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800223 "dm/bta_dm_act.cc",
224 "dm/bta_dm_cfg.cc",
225 "dm/bta_dm_ci.cc",
226 "dm/bta_dm_main.cc",
227 "dm/bta_dm_pm.cc",
228 "gatt/bta_gattc_act.cc",
229 "gatt/bta_gattc_api.cc",
230 "gatt/bta_gattc_cache.cc",
Jakub Pawlowski1ed87e92022-04-08 15:54:13 +0200231 "gatt/bta_gattc_db_storage.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800232 "gatt/bta_gattc_main.cc",
233 "gatt/bta_gattc_queue.cc",
234 "gatt/bta_gattc_utils.cc",
235 "gatt/database.cc",
236 "gatt/database_builder.cc",
237 "hh/bta_hh_act.cc",
Chris Manton847dc382021-05-12 10:08:48 -0700238 "hh/bta_hh_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800239 "hh/bta_hh_cfg.cc",
240 "hh/bta_hh_le.cc",
241 "hh/bta_hh_main.cc",
242 "hh/bta_hh_utils.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700243 "pan/bta_pan_act.cc",
244 "pan/bta_pan_api.cc",
245 "pan/bta_pan_main.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800246 "sys/bta_sys_conn.cc",
247 "sys/bta_sys_main.cc",
248 "test/bta_dm_test.cc",
Chris Manton607b8c02021-05-07 09:45:55 -0700249 "test/bta_gatt_test.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700250 "test/bta_pan_test.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800251 ],
252 shared_libs: [
Yi Kong2fb33f82021-12-16 02:46:09 +0800253 "libbase",
Chris Manton445082d2021-02-07 20:26:22 -0800254 "libcrypto",
255 "liblog",
256 "libprotobuf-cpp-lite",
257 ],
258 static_libs: [
259 "libbluetooth-types",
260 "libbt-common",
261 "libbt-protos-lite",
262 "libbtcore",
William Escandeae01e9b2022-03-10 12:48:12 +0000263 "libflatbuffers-cpp",
Chris Manton445082d2021-02-07 20:26:22 -0800264 "libgmock",
265 ],
Chris Manton29deec22021-07-14 10:03:54 -0700266 sanitize: {
267 address: true,
268 cfi: true,
269 misc_undefined: ["bounds"],
270 },
Chris Manton445082d2021-02-07 20:26:22 -0800271}
272
Song Gaoe2253a52019-12-10 10:36:17 +0800273// bta hf client add record tests for target
Song Gaoe2253a52019-12-10 10:36:17 +0800274cc_test {
275 name: "net_test_hf_client_add_record",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000276 defaults: [
277 "fluoride_defaults",
278 "mts_defaults",
279 ],
Song Gaoe2253a52019-12-10 10:36:17 +0800280 test_suites: ["device-tests"],
281 include_dirs: [
282 "packages/modules/Bluetooth/system",
Chris Manton131f21c2021-06-08 17:38:06 -0700283 "packages/modules/Bluetooth/system/gd",
Song Gaoe2253a52019-12-10 10:36:17 +0800284 "packages/modules/Bluetooth/system/bta/include",
285 "packages/modules/Bluetooth/system/bta/sys",
286 "packages/modules/Bluetooth/system/btif/include",
287 "packages/modules/Bluetooth/system/internal_include",
288 "packages/modules/Bluetooth/system/stack/include",
289 "packages/modules/Bluetooth/system/utils/include",
290 ],
291 srcs: [
292 "test/bta_hf_client_add_record_test.cc",
293 ],
294 header_libs: ["libbluetooth_headers"],
295 shared_libs: [
296 "libcutils",
297 "liblog",
298 ],
299 static_libs: [
300 "libbluetooth-types",
301 "libosi",
302 ],
303 cflags: ["-DBUILDCFG"],
304}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000305
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000306// csis unit tests for host
307cc_test {
308 name: "bluetooth_csis_test",
309 test_suites: ["device-tests"],
310 defaults: [
311 "fluoride_bta_defaults",
312 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000313 "mts_defaults",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000314 ],
315 host_supported: true,
316 include_dirs: [
317 "packages/modules/Bluetooth/system",
318 "packages/modules/Bluetooth/system/bta/groups",
319 "packages/modules/Bluetooth/system/bta/include",
320 "packages/modules/Bluetooth/system/bta/test/common",
321 "packages/modules/Bluetooth/system/btif/include",
322 "packages/modules/Bluetooth/system/osi/include",
323 ],
324 srcs : [
325 ":TestMockBtif",
Chienyuan9c8568e2021-11-15 20:01:15 +0800326 ":TestMockMainShimLeScanning",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000327 "csis/csis_client.cc",
328 "csis/csis_client_test.cc",
329 "groups/groups.cc",
330 "gatt/database.cc",
331 "gatt/database_builder.cc",
332 "test/common/bta_dm_api_mock.cc",
333 "test/common/bta_gatt_api_mock.cc",
334 "test/common/bta_gatt_queue_mock.cc",
335 "test/common/btm_api_mock.cc",
336 ],
337 shared_libs: [
338 "libprotobuf-cpp-lite",
339 "libcrypto",
340 ],
341 static_libs : [
342 "crypto_toolbox_for_tests",
343 "libgmock",
344 "libbt-common",
345 "libbt-protos-lite",
346 "libosi",
347 ],
348 sanitize: {
349 cfi: true,
350 scs: true,
351 address: true,
352 all_undefined: true,
353 integer_overflow: true,
354 diag: {
355 undefined : true
356 },
357 },
358}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000359
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +0000360// groups unit tests for host
361cc_test {
362 name: "bluetooth_groups_test",
363 test_suites: ["device-tests"],
364 defaults: [
365 "fluoride_bta_defaults",
366 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000367 "mts_defaults",
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +0000368 ],
369 host_supported: true,
370 include_dirs: [
371 "packages/modules/Bluetooth/system",
372 "packages/modules/Bluetooth/system/bta/include",
373 ],
374 srcs : [
375 ":TestMockBtif",
376 "groups/groups_test.cc",
377 "groups/groups.cc",
378 ],
379 shared_libs: [
380 "libprotobuf-cpp-lite",
381 "libcrypto",
382 ],
383 static_libs : [
384 "crypto_toolbox_for_tests",
385 "libgmock",
386 "libbt-common",
387 "libbt-protos-lite",
388 "libosi",
389 ],
390 sanitize: {
391 cfi: true,
392 scs: true,
393 address: true,
394 all_undefined: true,
395 integer_overflow: true,
396 diag: {
397 undefined : true
398 },
399 },
400}
401
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000402// bta unit tests for host
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000403cc_test {
404 name: "bluetooth_vc_test",
405 test_suites: ["device-tests"],
406 defaults: [
407 "fluoride_bta_defaults",
408 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000409 "mts_defaults",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000410 ],
411 host_supported: true,
412 include_dirs: [
413 "packages/modules/Bluetooth/system",
414 "packages/modules/Bluetooth/system/bta/include",
415 "packages/modules/Bluetooth/system/bta/test/common",
Łukasz Rymanowski9f3756e2022-05-06 11:59:36 +0000416 "packages/modules/Bluetooth/system/gd",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000417 "packages/modules/Bluetooth/system/stack/include",
418 ],
419 srcs : [
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000420 ":TestMockOsi",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000421 "gatt/database.cc",
422 "gatt/database_builder.cc",
423 "test/common/bta_gatt_api_mock.cc",
424 "test/common/bta_gatt_queue_mock.cc",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000425 "test/common/mock_csis_client.cc",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000426 "test/common/btm_api_mock.cc",
427 "vc/devices_test.cc",
428 "vc/device.cc",
429 "vc/vc.cc",
430 "vc/vc_test.cc",
431 ],
432 shared_libs: [
433 "libprotobuf-cpp-lite",
434 "libcrypto",
435 ],
436 static_libs : [
437 "crypto_toolbox_for_tests",
438 "libgmock",
439 "libbt-common",
440 "libbt-protos-lite",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000441 "libosi"
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000442 ],
443 sanitize: {
444 cfi: false,
445 },
446}
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000447
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000448genrule {
449 name: "LeAudioSetConfigSchemas_h",
450 tools: [
451 "flatc",
452 ],
453 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -o $(genDir) --cpp $(in) ",
454 srcs: [
455 "le_audio/audio_set_configurations.fbs",
456 "le_audio/audio_set_scenarios.fbs",
457 ],
458 out: [
459 "audio_set_configurations_generated.h",
460 "audio_set_scenarios_generated.h",
461 ],
462}
463
464genrule {
465 name: "LeAudioSetScenariosSchema_bfbs",
466 tools: [
467 "flatc",
468 ],
469 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
470 srcs: [
471 "le_audio/audio_set_scenarios.fbs",
472 ],
473 out: [
474 "audio_set_scenarios.bfbs",
475 ],
476}
477
478genrule {
479 name: "LeAudioSetConfigsSchema_bfbs",
480 tools: [
481 "flatc",
482 ],
483 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
484 srcs: [
485 "le_audio/audio_set_configurations.fbs",
486 ],
487 out: [
488 "audio_set_configurations.bfbs",
489 ],
490}
491
492prebuilt_etc {
493 name: "audio_set_scenarios_bfbs",
494 src: ":LeAudioSetScenariosSchema_bfbs",
495 filename: "audio_set_scenarios.bfbs",
496 sub_dir: "bluetooth/le_audio",
497}
498
499prebuilt_etc {
500 name: "audio_set_scenarios_json",
501 src: "le_audio/audio_set_scenarios.json",
502 filename_from_src: true,
503 sub_dir: "bluetooth/le_audio",
504}
505
506prebuilt_etc {
507 name: "audio_set_configurations_bfbs",
508 src: ":LeAudioSetConfigsSchema_bfbs",
509 filename: "audio_set_configurations.bfbs",
510 sub_dir: "bluetooth/le_audio",
511}
512
513prebuilt_etc {
514 name: "audio_set_configurations_json",
515 src: "le_audio/audio_set_configurations.json",
516 filename_from_src: true,
517 sub_dir: "bluetooth/le_audio",
518}
519
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000520// bta unit tests for LE Audio
521// ========================================================
522cc_test {
523 name: "bluetooth_le_audio_test",
524 test_suites: ["device-tests"],
525 defaults: [
526 "fluoride_defaults",
527 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000528 "mts_defaults",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000529 ],
530 host_supported: true,
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000531 target: {
532 darwin: {
533 enabled: false,
534 },
535 android: {
536 cflags: [
537 "-DOS_ANDROID",
538 ],
539 sanitize: {
540 misc_undefined: ["bounds"],
541 },
542 },
543 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000544 include_dirs: [
545 "packages/modules/Bluetooth/system",
546 "packages/modules/Bluetooth/system/bta/include",
547 "packages/modules/Bluetooth/system/bta/test/common",
548 "packages/modules/Bluetooth/system/btif/include",
549 "packages/modules/Bluetooth/system/gd",
550 "packages/modules/Bluetooth/system/stack/include",
551 ],
552 srcs : [
553 ":TestStubOsi",
Alice Kuo422f55d2021-12-30 11:33:32 +0800554 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000555 "test/common/bta_gatt_api_mock.cc",
556 "test/common/bta_gatt_queue_mock.cc",
557 "test/common/btm_api_mock.cc",
558 "le_audio/client_audio.cc",
559 "le_audio/client_audio_test.cc",
560 "le_audio/client_parser.cc",
561 "le_audio/client_parser_test.cc",
562 "le_audio/devices.cc",
563 "le_audio/devices_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000564 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000565 "le_audio/le_audio_types.cc",
566 "le_audio/le_audio_types_test.cc",
Josh Wuc033a162022-05-05 01:29:04 -0700567 "le_audio/metrics_collector_linux.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000568 "le_audio/mock_iso_manager.cc",
569 "test/common/mock_controller.cc",
570 "le_audio/state_machine.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800571 "le_audio/state_machine_test.cc",
572 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000573 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000574 data: [
575 ":audio_set_scenarios_bfbs",
576 ":audio_set_scenarios_json",
577 ":audio_set_configurations_bfbs",
578 ":audio_set_configurations_json"
579 ],
580 generated_headers: [
581 "LeAudioSetConfigSchemas_h",
582 ],
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000583 shared_libs: [
584 "libprotobuf-cpp-lite",
585 "libcrypto",
586 "liblog", // __android_log_print
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000587 "android.hardware.bluetooth.audio@2.0",
588 "android.hardware.bluetooth.audio@2.1",
589 "libhidlbase",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000590 ],
591 static_libs : [
592 "libgmock",
593 "libbt-common",
594 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000595 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000596 "libosi",
597 ],
598 sanitize: {
599 cfi: false,
600 },
601}
602
603cc_test {
604 name: "bluetooth_le_audio_client_test",
605 test_suites: ["device-tests"],
606 defaults: [
607 "fluoride_bta_defaults",
608 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000609 "mts_defaults",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000610 ],
611 host_supported: true,
612 include_dirs: [
613 "packages/modules/Bluetooth/system",
614 "packages/modules/Bluetooth/system/bta/include",
615 "packages/modules/Bluetooth/system/bta/test/common",
616 "packages/modules/Bluetooth/system/stack/include",
617 ],
618 srcs : [
Łukasz Rymanowskiaf2d9512022-01-20 22:23:14 +0000619 ":TestStubOsi",
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700620 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000621 "gatt/database.cc",
622 "gatt/database_builder.cc",
623 "le_audio/client.cc",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000624 "le_audio/client_audio.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000625 "le_audio/client_parser.cc",
626 "le_audio/devices.cc",
627 "le_audio/le_audio_client_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000628 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000629 "le_audio/le_audio_types.cc",
Josh Wuc033a162022-05-05 01:29:04 -0700630 "le_audio/metrics_collector.cc",
631 "le_audio/metrics_collector_test.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000632 "le_audio/mock_iso_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000633 "le_audio/mock_state_machine.cc",
634 "test/common/btm_api_mock.cc",
635 "test/common/bta_gatt_api_mock.cc",
636 "test/common/bta_gatt_queue_mock.cc",
637 "test/common/btif_storage_mock.cc",
638 "test/common/mock_csis_client.cc",
639 "test/common/mock_controller.cc",
640 "test/common/mock_device_groups.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800641 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000642 ],
643 shared_libs: [
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700644 "android.hardware.bluetooth.audio@2.0",
645 "android.hardware.bluetooth.audio@2.1",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000646 "libhidlbase",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000647 "libprotobuf-cpp-lite",
648 "libcrypto",
649 "liblog",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000650 "libfmq",
651 "libbinder_ndk",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000652 ],
653 static_libs : [
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000654 "libbt-audio-hal-interface",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000655 "crypto_toolbox_for_tests",
656 "libgmock",
657 "libbt-common",
658 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000659 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000660 "libosi",
Jakub Pawlowskid0a41af2022-01-03 17:53:02 +0100661 "liblc3",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000662 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000663 data: [
664 ":audio_set_scenarios_bfbs",
665 ":audio_set_scenarios_json",
666 ":audio_set_configurations_bfbs",
667 ":audio_set_configurations_json",
668 ],
669 generated_headers: [
670 "LeAudioSetConfigSchemas_h",
671 ],
Josh Wu28d6da12021-12-22 06:13:40 -0800672 target: {
673 android: {
674 shared_libs: [
675 "libbinder_ndk",
Omer Osman066fa552022-05-01 03:22:13 +0000676 "android.hardware.bluetooth.audio-V2-ndk",
Josh Wu28d6da12021-12-22 06:13:40 -0800677 ],
678 },
679 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000680 sanitize: {
681 cfi: true,
682 scs: true,
683 address: true,
684 all_undefined: true,
685 integer_overflow: true,
686 diag: {
687 undefined : true
688 },
689 },
690}
691
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100692cc_test {
693 name: "bluetooth_test_broadcaster_sm",
694 test_suites: ["device-tests"],
695 defaults: [
696 "fluoride_bta_defaults",
697 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000698 "mts_defaults",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100699 ],
700 host_supported: true,
701 include_dirs: [
702 "packages/modules/Bluetooth/system",
703 "packages/modules/Bluetooth/system/bta/include",
704 "packages/modules/Bluetooth/system/bta/le_audio",
705 "packages/modules/Bluetooth/system/btif/include",
706 "packages/modules/Bluetooth/system/stack/include",
707 "packages/modules/Bluetooth/system/stack/btm",
708 ],
709 srcs : [
710 "le_audio/broadcaster/broadcaster_types.cc",
711 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
712 "le_audio/broadcaster/state_machine.cc",
713 "le_audio/broadcaster/state_machine_test.cc",
714 "le_audio/le_audio_types.cc",
715 "le_audio/mock_iso_manager.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800716 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100717 ],
718 shared_libs: [
719 "libprotobuf-cpp-lite",
720 "libcrypto",
721 ],
722 static_libs : [
723 "libgmock",
724 "libbt-common",
725 "libbt-protos-lite",
726 "liblc3",
727 ],
728 sanitize: {
729 cfi: true,
730 scs: true,
731 address: true,
732 all_undefined: true,
733 integer_overflow: true,
734 diag: {
735 undefined : true
736 },
737 },
738}
739
740cc_test {
741 name: "bluetooth_test_broadcaster",
742 test_suites: ["device-tests"],
743 defaults: [
744 "fluoride_bta_defaults",
745 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000746 "mts_defaults",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100747 ],
748 host_supported: true,
749 include_dirs: [
750 "packages/modules/Bluetooth/system",
751 "packages/modules/Bluetooth/system/bta/include",
752 "packages/modules/Bluetooth/system/bta/le_audio",
753 "packages/modules/Bluetooth/system/bta/test/common",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100754 "packages/modules/Bluetooth/system/btif/include",
755 "packages/modules/Bluetooth/system/stack/include",
756 "packages/modules/Bluetooth/system/stack/btm",
757 ],
758 srcs : [
759 ":TestStubOsi",
760 "le_audio/broadcaster/broadcaster.cc",
761 "le_audio/broadcaster/broadcaster_test.cc",
762 "le_audio/broadcaster/broadcaster_types.cc",
763 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
764 "le_audio/broadcaster/mock_state_machine.cc",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000765 "le_audio/client_audio.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100766 "le_audio/le_audio_types.cc",
767 "le_audio/mock_iso_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100768 "test/common/mock_controller.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800769 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100770 ],
771 shared_libs: [
772 "libprotobuf-cpp-lite",
773 "libcrypto",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000774 "libfmq",
775 "libbinder_ndk",
776 "android.hardware.bluetooth.audio@2.0",
777 "android.hardware.bluetooth.audio@2.1",
778 "libhidlbase",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100779 ],
780 static_libs : [
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000781 "libbt-audio-hal-interface",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100782 "libgmock",
783 "libbt-common",
784 "libbt-protos-lite",
785 "libosi",
786 "liblc3",
787 ],
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000788 target: {
789 android: {
790 shared_libs: [
791 "libbinder_ndk",
Omer Osman066fa552022-05-01 03:22:13 +0000792 "android.hardware.bluetooth.audio-V2-ndk",
Grzegorz Kołodziejczyk4b8839d2022-03-08 14:53:55 +0000793 ],
794 },
795 },
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100796 sanitize: {
797 cfi: true,
798 scs: true,
799 address: true,
800 all_undefined: true,
801 integer_overflow: true,
802 diag: {
803 undefined : true
804 },
805 },
806}
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000807
808cc_test {
809 name: "bluetooth_has_test",
810 test_suites: ["device-tests"],
811 defaults: [
812 "fluoride_bta_defaults",
813 "clang_coverage_bin",
Etienne Ruffieuxc3680d22022-05-19 04:22:04 +0000814 "mts_defaults",
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000815 ],
816 host_supported: true,
817 include_dirs: [
818 "packages/modules/Bluetooth/system",
819 "packages/modules/Bluetooth/system/bta/include",
820 "packages/modules/Bluetooth/system/bta/test/common",
821 "packages/modules/Bluetooth/system/stack/include",
822 ],
823 srcs : [
824 "gatt/database.cc",
825 "gatt/database_builder.cc",
826 "has/has_client.cc",
827 "has/has_client_test.cc",
828 "has/has_ctp.cc",
829 "has/has_journal.cc",
830 "has/has_preset.cc",
831 "has/has_types.cc",
832 "test/common/bta_gatt_api_mock.cc",
833 "test/common/bta_gatt_queue_mock.cc",
834 "test/common/btif_storage_mock.cc",
835 "test/common/btm_api_mock.cc",
836 "test/common/mock_controller.cc",
837 "test/common/mock_csis_client.cc",
838 ],
839 shared_libs: [
840 "libprotobuf-cpp-lite",
841 "libcrypto",
842 ],
843 static_libs : [
844 "crypto_toolbox_for_tests",
845 "libgmock",
846 "libbt-common",
847 "libbt-protos-lite",
848 ],
849 sanitize: {
850 cfi: true,
851 scs: true,
852 address: true,
853 all_undefined: true,
854 integer_overflow: true,
855 diag: {
856 undefined : true
857 },
858 },
ahujapalash5add3d52022-03-10 18:38:02 +0000859}