blob: b48e7389f90392ee26bc1e36331299707a8a0c66 [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",
12 defaults: ["fluoride_defaults"],
13 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 ],
34 shared_libs: [
35 "libcutils",
36 ],
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070037 header_libs: ["libbluetooth_headers"],
Jack He65b2a572016-12-07 18:25:17 -080038 cflags: ["-DBUILDCFG"],
39}
40
Chris Mantona9c16c82021-07-08 08:22:48 -070041filegroup {
42 name: "BtaDmSources",
43 srcs: [
44 "dm/bta_dm_act.cc",
45 "dm/bta_dm_api.cc",
46 "dm/bta_dm_cfg.cc",
47 "dm/bta_dm_ci.cc",
48 "dm/bta_dm_main.cc",
49 "dm/bta_dm_pm.cc",
50 ],
51}
52
Jack He65b2a572016-12-07 18:25:17 -080053// BTA static library for target
Jack He65b2a572016-12-07 18:25:17 -080054cc_library_static {
55 name: "libbt-bta",
56 defaults: ["fluoride_bta_defaults"],
57 srcs: [
Chris Mantona9c16c82021-07-08 08:22:48 -070058 ":BtaDmSources",
Jack He65b2a572016-12-07 18:25:17 -080059 "ag/bta_ag_act.cc",
60 "ag/bta_ag_api.cc",
61 "ag/bta_ag_at.cc",
62 "ag/bta_ag_cfg.cc",
Jack He65b2a572016-12-07 18:25:17 -080063 "ag/bta_ag_cmd.cc",
64 "ag/bta_ag_main.cc",
65 "ag/bta_ag_rfc.cc",
66 "ag/bta_ag_sco.cc",
67 "ag/bta_ag_sdp.cc",
68 "ar/bta_ar.cc",
69 "av/bta_av_aact.cc",
70 "av/bta_av_act.cc",
71 "av/bta_av_api.cc",
72 "av/bta_av_cfg.cc",
73 "av/bta_av_ci.cc",
74 "av/bta_av_main.cc",
75 "av/bta_av_ssm.cc",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +000076 "csis/csis_client.cc",
Jack He65b2a572016-12-07 18:25:17 -080077 "gatt/bta_gattc_act.cc",
78 "gatt/bta_gattc_api.cc",
79 "gatt/bta_gattc_cache.cc",
Jakub Pawlowski1ed87e92022-04-08 15:54:13 +020080 "gatt/bta_gattc_db_storage.cc",
Jack He65b2a572016-12-07 18:25:17 -080081 "gatt/bta_gattc_main.cc",
Jakub Pawlowski19d0aae2017-11-29 21:49:32 -080082 "gatt/bta_gattc_queue.cc",
Jack He65b2a572016-12-07 18:25:17 -080083 "gatt/bta_gattc_utils.cc",
84 "gatt/bta_gatts_act.cc",
85 "gatt/bta_gatts_api.cc",
86 "gatt/bta_gatts_main.cc",
sravan voleti898c0632022-03-10 09:00:24 +010087 "gatt/bta_gatts_queue.cc",
Jack He65b2a572016-12-07 18:25:17 -080088 "gatt/bta_gatts_utils.cc",
Jakub Pawlowski6d3cb112018-04-18 07:31:30 -070089 "gatt/database.cc",
90 "gatt/database_builder.cc",
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +000091 "groups/groups.cc",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +000092 "vc/device.cc",
93 "vc/vc.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +010094 "le_audio/broadcaster/broadcaster.cc",
95 "le_audio/broadcaster/broadcaster_types.cc",
96 "le_audio/broadcaster/state_machine.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +000097 "le_audio/client.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +080098 "le_audio/codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +000099 "le_audio/devices.cc",
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700100 "le_audio/hal_verifier.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000101 "le_audio/state_machine.cc",
102 "le_audio/client_parser.cc",
103 "le_audio/client_audio.cc",
Jakub Tyszkowskie82b5122022-01-18 18:38:06 +0000104 "le_audio/le_audio_set_configuration_provider.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000105 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000106 "le_audio/le_audio_types.cc",
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000107 "has/has_client.cc",
108 "has/has_ctp.cc",
109 "has/has_journal.cc",
110 "has/has_preset.cc",
111 "has/has_types.cc",
Jakub Pawlowski7d06e572018-02-28 22:44:42 -0800112 "hearing_aid/hearing_aid.cc",
Hansong Zhangd19e0272018-01-19 12:23:57 -0800113 "hearing_aid/hearing_aid_audio_source.cc",
Jack He65b2a572016-12-07 18:25:17 -0800114 "hf_client/bta_hf_client_act.cc",
115 "hf_client/bta_hf_client_api.cc",
116 "hf_client/bta_hf_client_at.cc",
117 "hf_client/bta_hf_client_main.cc",
118 "hf_client/bta_hf_client_rfc.cc",
119 "hf_client/bta_hf_client_sco.cc",
120 "hf_client/bta_hf_client_sdp.cc",
121 "hh/bta_hh_act.cc",
122 "hh/bta_hh_api.cc",
123 "hh/bta_hh_cfg.cc",
124 "hh/bta_hh_le.cc",
125 "hh/bta_hh_main.cc",
126 "hh/bta_hh_utils.cc",
Jack He65b2a572016-12-07 18:25:17 -0800127 "hd/bta_hd_act.cc",
128 "hd/bta_hd_api.cc",
129 "hd/bta_hd_main.cc",
130 "jv/bta_jv_act.cc",
131 "jv/bta_jv_api.cc",
132 "jv/bta_jv_cfg.cc",
Jack He65b2a572016-12-07 18:25:17 -0800133 "pan/bta_pan_act.cc",
134 "pan/bta_pan_api.cc",
135 "pan/bta_pan_ci.cc",
136 "pan/bta_pan_main.cc",
137 "sdp/bta_sdp.cc",
138 "sdp/bta_sdp_act.cc",
139 "sdp/bta_sdp_api.cc",
140 "sdp/bta_sdp_cfg.cc",
141 "sys/bta_sys_conn.cc",
142 "sys/bta_sys_main.cc",
143 "sys/utl.cc",
144 ],
Ajay Panicker0ad702c2018-03-16 17:13:50 -0700145 static_libs: [
146 "avrcp-target-service",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000147 "libflatbuffers-cpp",
Ajay Panicker0ad702c2018-03-16 17:13:50 -0700148 "lib-bt-packets",
Chen Chenb61f4b82022-01-10 13:31:44 -0800149 "libbt-platform-protos-lite",
Ajay Panicker0ad702c2018-03-16 17:13:50 -0700150 ],
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700151 shared_libs: [
152 "android.hardware.bluetooth.audio@2.0",
153 "android.hardware.bluetooth.audio@2.1",
154 ],
Josh Wu28d6da12021-12-22 06:13:40 -0800155 target: {
156 android: {
157 shared_libs: [
158 "android.hardware.bluetooth.audio-V1-ndk",
159 ],
160 },
161 },
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000162 generated_headers: [
163 "LeAudioSetConfigSchemas_h",
164 ],
Hansong Zhang777b6342021-02-23 15:52:11 -0800165 host_supported: true,
Jack He65b2a572016-12-07 18:25:17 -0800166}
167
168// bta unit tests for target
Jack He65b2a572016-12-07 18:25:17 -0800169cc_test {
170 name: "net_test_bta",
171 defaults: ["fluoride_bta_defaults"],
Yanfei Zhoud2439812018-08-28 10:58:52 +0800172 test_suites: ["device-tests"],
Jack He65b2a572016-12-07 18:25:17 -0800173 srcs: [
Chris Manton8fe47512021-09-24 13:30:54 -0700174 ":TestMockStackBtm",
175 ":TestCommonMockFunctions",
Jack He65b2a572016-12-07 18:25:17 -0800176 "test/bta_hf_client_test.cc",
Yanfei Zhoud2439812018-08-28 10:58:52 +0800177 "test/bta_dm_cust_uuid_test.cc",
Fei Zhenga6d4be12019-12-25 10:45:51 +0800178 "test/bta_dip_test.cc",
Jakub Pawlowski6d3cb112018-04-18 07:31:30 -0700179 "test/gatt/database_builder_test.cc",
180 "test/gatt/database_builder_sample_device_test.cc",
181 "test/gatt/database_test.cc",
Jack He65b2a572016-12-07 18:25:17 -0800182 ],
183 shared_libs: [
Hansong Zhang8bb04bb2018-12-12 14:52:00 -0800184 "libcrypto",
Jack He65b2a572016-12-07 18:25:17 -0800185 "liblog",
186 "libprotobuf-cpp-lite",
187 ],
188 static_libs: [
HsingYuan Lo2d3da482020-08-18 09:30:32 +0200189 "crypto_toolbox_for_tests",
Jack He65b2a572016-12-07 18:25:17 -0800190 "libbtcore",
191 "libbt-bta",
Cheney Ni895430b2018-12-12 20:20:28 +0800192 "libbt-audio-hal-interface",
Jakub Pawlowskif9f45852017-07-03 15:39:36 -0700193 "libbluetooth-types",
Jack He9a30a9f2018-03-03 00:03:25 -0800194 "libbt-protos-lite",
Jack He65b2a572016-12-07 18:25:17 -0800195 "libosi",
Jack He42823982018-08-15 12:38:37 -0700196 "libbt-common",
Jack He65b2a572016-12-07 18:25:17 -0800197 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000198 data: [
199 ":audio_set_scenarios_bfbs",
200 ":audio_set_scenarios_json",
201 ":audio_set_configurations_bfbs",
202 ":audio_set_configurations_json",
203 ],
Jack He65b2a572016-12-07 18:25:17 -0800204}
Song Gaoe2253a52019-12-10 10:36:17 +0800205
Chris Manton445082d2021-02-07 20:26:22 -0800206cc_test {
207 name: "bt_host_test_bta",
208 defaults: ["fluoride_bta_defaults"],
209 test_suites: ["device-tests"],
210 host_supported: true,
211 include_dirs: [
212 "packages/modules/Bluetooth/system",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700213 "packages/modules/Bluetooth/system/gd",
214 ],
215 generated_headers: [
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700216 "BluetoothGeneratedDumpsysDataSchema_h",
217 "BluetoothGeneratedPackets_h",
Chris Manton445082d2021-02-07 20:26:22 -0800218 ],
219 srcs: [
Chris Manton29deec22021-07-14 10:03:54 -0700220 ":OsiCompatSources",
Chris Manton847dc382021-05-12 10:08:48 -0700221 ":TestCommonMainHandler",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700222 ":TestMockBtif",
223 ":TestMockDevice",
224 ":TestMockMainShim",
Chris Manton29deec22021-07-14 10:03:54 -0700225 ":TestMockOsi",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700226 ":TestMockStack",
Chris Manton866c5da2021-07-15 22:21:18 -0700227 "ar/bta_ar.cc",
228 "dm/bta_dm_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800229 "dm/bta_dm_act.cc",
230 "dm/bta_dm_cfg.cc",
231 "dm/bta_dm_ci.cc",
232 "dm/bta_dm_main.cc",
233 "dm/bta_dm_pm.cc",
234 "gatt/bta_gattc_act.cc",
235 "gatt/bta_gattc_api.cc",
236 "gatt/bta_gattc_cache.cc",
Jakub Pawlowski1ed87e92022-04-08 15:54:13 +0200237 "gatt/bta_gattc_db_storage.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800238 "gatt/bta_gattc_main.cc",
239 "gatt/bta_gattc_queue.cc",
240 "gatt/bta_gattc_utils.cc",
241 "gatt/database.cc",
242 "gatt/database_builder.cc",
243 "hh/bta_hh_act.cc",
Chris Manton847dc382021-05-12 10:08:48 -0700244 "hh/bta_hh_api.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800245 "hh/bta_hh_cfg.cc",
246 "hh/bta_hh_le.cc",
247 "hh/bta_hh_main.cc",
248 "hh/bta_hh_utils.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700249 "pan/bta_pan_act.cc",
250 "pan/bta_pan_api.cc",
251 "pan/bta_pan_main.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800252 "sys/bta_sys_conn.cc",
253 "sys/bta_sys_main.cc",
254 "test/bta_dm_test.cc",
Chris Manton607b8c02021-05-07 09:45:55 -0700255 "test/bta_gatt_test.cc",
Chris Manton3dc9ad82021-10-10 17:23:19 -0700256 "test/bta_pan_test.cc",
Chris Manton445082d2021-02-07 20:26:22 -0800257 ],
258 shared_libs: [
Yi Kong2fb33f82021-12-16 02:46:09 +0800259 "libbase",
Chris Manton445082d2021-02-07 20:26:22 -0800260 "libcrypto",
Chris Manton6aa6c0d2021-04-30 15:21:38 -0700261 "libflatbuffers-cpp",
Chris Manton445082d2021-02-07 20:26:22 -0800262 "liblog",
263 "libprotobuf-cpp-lite",
264 ],
265 static_libs: [
266 "libbluetooth-types",
267 "libbt-common",
268 "libbt-protos-lite",
269 "libbtcore",
270 "libgmock",
271 ],
Chris Manton29deec22021-07-14 10:03:54 -0700272 sanitize: {
273 address: true,
274 cfi: true,
275 misc_undefined: ["bounds"],
276 },
Chris Manton445082d2021-02-07 20:26:22 -0800277}
278
Song Gaoe2253a52019-12-10 10:36:17 +0800279// bta hf client add record tests for target
Song Gaoe2253a52019-12-10 10:36:17 +0800280cc_test {
281 name: "net_test_hf_client_add_record",
282 defaults: ["fluoride_defaults"],
283 test_suites: ["device-tests"],
284 include_dirs: [
285 "packages/modules/Bluetooth/system",
Chris Manton131f21c2021-06-08 17:38:06 -0700286 "packages/modules/Bluetooth/system/gd",
Song Gaoe2253a52019-12-10 10:36:17 +0800287 "packages/modules/Bluetooth/system/bta/include",
288 "packages/modules/Bluetooth/system/bta/sys",
289 "packages/modules/Bluetooth/system/btif/include",
290 "packages/modules/Bluetooth/system/internal_include",
291 "packages/modules/Bluetooth/system/stack/include",
292 "packages/modules/Bluetooth/system/utils/include",
293 ],
294 srcs: [
295 "test/bta_hf_client_add_record_test.cc",
296 ],
297 header_libs: ["libbluetooth_headers"],
298 shared_libs: [
299 "libcutils",
300 "liblog",
301 ],
302 static_libs: [
303 "libbluetooth-types",
304 "libosi",
305 ],
306 cflags: ["-DBUILDCFG"],
307}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000308
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000309// csis unit tests for host
310cc_test {
311 name: "bluetooth_csis_test",
312 test_suites: ["device-tests"],
313 defaults: [
314 "fluoride_bta_defaults",
315 "clang_coverage_bin",
316 ],
317 host_supported: true,
318 include_dirs: [
319 "packages/modules/Bluetooth/system",
320 "packages/modules/Bluetooth/system/bta/groups",
321 "packages/modules/Bluetooth/system/bta/include",
322 "packages/modules/Bluetooth/system/bta/test/common",
323 "packages/modules/Bluetooth/system/btif/include",
324 "packages/modules/Bluetooth/system/osi/include",
325 ],
326 srcs : [
327 ":TestMockBtif",
Chienyuan9c8568e2021-11-15 20:01:15 +0800328 ":TestMockMainShimLeScanning",
Łukasz Rymanowski06a5be22020-12-15 09:14:51 +0000329 "csis/csis_client.cc",
330 "csis/csis_client_test.cc",
331 "groups/groups.cc",
332 "gatt/database.cc",
333 "gatt/database_builder.cc",
334 "test/common/bta_dm_api_mock.cc",
335 "test/common/bta_gatt_api_mock.cc",
336 "test/common/bta_gatt_queue_mock.cc",
337 "test/common/btm_api_mock.cc",
338 ],
339 shared_libs: [
340 "libprotobuf-cpp-lite",
341 "libcrypto",
342 ],
343 static_libs : [
344 "crypto_toolbox_for_tests",
345 "libgmock",
346 "libbt-common",
347 "libbt-protos-lite",
348 "libosi",
349 ],
350 sanitize: {
351 cfi: true,
352 scs: true,
353 address: true,
354 all_undefined: true,
355 integer_overflow: true,
356 diag: {
357 undefined : true
358 },
359 },
360}
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000361
Łukasz Rymanowskia6b83332020-12-13 07:12:57 +0000362// groups unit tests for host
363cc_test {
364 name: "bluetooth_groups_test",
365 test_suites: ["device-tests"],
366 defaults: [
367 "fluoride_bta_defaults",
368 "clang_coverage_bin",
369 ],
370 host_supported: true,
371 include_dirs: [
372 "packages/modules/Bluetooth/system",
373 "packages/modules/Bluetooth/system/bta/include",
374 ],
375 srcs : [
376 ":TestMockBtif",
377 "groups/groups_test.cc",
378 "groups/groups.cc",
379 ],
380 shared_libs: [
381 "libprotobuf-cpp-lite",
382 "libcrypto",
383 ],
384 static_libs : [
385 "crypto_toolbox_for_tests",
386 "libgmock",
387 "libbt-common",
388 "libbt-protos-lite",
389 "libosi",
390 ],
391 sanitize: {
392 cfi: true,
393 scs: true,
394 address: true,
395 all_undefined: true,
396 integer_overflow: true,
397 diag: {
398 undefined : true
399 },
400 },
401}
402
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000403// bta unit tests for host
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000404cc_test {
405 name: "bluetooth_vc_test",
406 test_suites: ["device-tests"],
407 defaults: [
408 "fluoride_bta_defaults",
409 "clang_coverage_bin",
410 ],
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",
416 "packages/modules/Bluetooth/system/stack/include",
417 ],
418 srcs : [
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000419 ":TestMockOsi",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000420 "gatt/database.cc",
421 "gatt/database_builder.cc",
422 "test/common/bta_gatt_api_mock.cc",
423 "test/common/bta_gatt_queue_mock.cc",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000424 "test/common/mock_csis_client.cc",
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000425 "test/common/btm_api_mock.cc",
426 "vc/devices_test.cc",
427 "vc/device.cc",
428 "vc/vc.cc",
429 "vc/vc_test.cc",
430 ],
431 shared_libs: [
432 "libprotobuf-cpp-lite",
433 "libcrypto",
434 ],
435 static_libs : [
436 "crypto_toolbox_for_tests",
437 "libgmock",
438 "libbt-common",
439 "libbt-protos-lite",
Łukasz Rymanowski3e620852021-08-25 16:46:05 +0000440 "libosi"
Łukasz Rymanowski35b08362021-01-29 09:05:10 +0000441 ],
442 sanitize: {
443 cfi: false,
444 },
445}
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000446
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000447genrule {
448 name: "LeAudioSetConfigSchemas_h",
449 tools: [
450 "flatc",
451 ],
452 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -o $(genDir) --cpp $(in) ",
453 srcs: [
454 "le_audio/audio_set_configurations.fbs",
455 "le_audio/audio_set_scenarios.fbs",
456 ],
457 out: [
458 "audio_set_configurations_generated.h",
459 "audio_set_scenarios_generated.h",
460 ],
461}
462
463genrule {
464 name: "LeAudioSetScenariosSchema_bfbs",
465 tools: [
466 "flatc",
467 ],
468 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
469 srcs: [
470 "le_audio/audio_set_scenarios.fbs",
471 ],
472 out: [
473 "audio_set_scenarios.bfbs",
474 ],
475}
476
477genrule {
478 name: "LeAudioSetConfigsSchema_bfbs",
479 tools: [
480 "flatc",
481 ],
482 cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
483 srcs: [
484 "le_audio/audio_set_configurations.fbs",
485 ],
486 out: [
487 "audio_set_configurations.bfbs",
488 ],
489}
490
491prebuilt_etc {
492 name: "audio_set_scenarios_bfbs",
493 src: ":LeAudioSetScenariosSchema_bfbs",
494 filename: "audio_set_scenarios.bfbs",
495 sub_dir: "bluetooth/le_audio",
496}
497
498prebuilt_etc {
499 name: "audio_set_scenarios_json",
500 src: "le_audio/audio_set_scenarios.json",
501 filename_from_src: true,
502 sub_dir: "bluetooth/le_audio",
503}
504
505prebuilt_etc {
506 name: "audio_set_configurations_bfbs",
507 src: ":LeAudioSetConfigsSchema_bfbs",
508 filename: "audio_set_configurations.bfbs",
509 sub_dir: "bluetooth/le_audio",
510}
511
512prebuilt_etc {
513 name: "audio_set_configurations_json",
514 src: "le_audio/audio_set_configurations.json",
515 filename_from_src: true,
516 sub_dir: "bluetooth/le_audio",
517}
518
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000519// bta unit tests for LE Audio
520// ========================================================
521cc_test {
522 name: "bluetooth_le_audio_test",
523 test_suites: ["device-tests"],
524 defaults: [
525 "fluoride_defaults",
526 "clang_coverage_bin",
527 ],
528 host_supported: true,
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000529 target: {
530 darwin: {
531 enabled: false,
532 },
533 android: {
534 cflags: [
535 "-DOS_ANDROID",
536 ],
537 sanitize: {
538 misc_undefined: ["bounds"],
539 },
540 },
541 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000542 include_dirs: [
543 "packages/modules/Bluetooth/system",
544 "packages/modules/Bluetooth/system/bta/include",
545 "packages/modules/Bluetooth/system/bta/test/common",
546 "packages/modules/Bluetooth/system/btif/include",
547 "packages/modules/Bluetooth/system/gd",
548 "packages/modules/Bluetooth/system/stack/include",
549 ],
550 srcs : [
551 ":TestStubOsi",
Alice Kuo422f55d2021-12-30 11:33:32 +0800552 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000553 "test/common/bta_gatt_api_mock.cc",
554 "test/common/bta_gatt_queue_mock.cc",
555 "test/common/btm_api_mock.cc",
556 "le_audio/client_audio.cc",
557 "le_audio/client_audio_test.cc",
558 "le_audio/client_parser.cc",
559 "le_audio/client_parser_test.cc",
560 "le_audio/devices.cc",
561 "le_audio/devices_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000562 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000563 "le_audio/le_audio_types.cc",
564 "le_audio/le_audio_types_test.cc",
565 "le_audio/mock_iso_manager.cc",
566 "test/common/mock_controller.cc",
567 "le_audio/state_machine.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800568 "le_audio/state_machine_test.cc",
569 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000570 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000571 data: [
572 ":audio_set_scenarios_bfbs",
573 ":audio_set_scenarios_json",
574 ":audio_set_configurations_bfbs",
575 ":audio_set_configurations_json"
576 ],
577 generated_headers: [
578 "LeAudioSetConfigSchemas_h",
579 ],
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000580 shared_libs: [
581 "libprotobuf-cpp-lite",
582 "libcrypto",
583 "liblog", // __android_log_print
584 ],
585 static_libs : [
586 "libgmock",
587 "libbt-common",
588 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000589 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000590 "libosi",
591 ],
592 sanitize: {
593 cfi: false,
594 },
595}
596
597cc_test {
598 name: "bluetooth_le_audio_client_test",
599 test_suites: ["device-tests"],
600 defaults: [
601 "fluoride_bta_defaults",
602 "clang_coverage_bin",
603 ],
604 host_supported: true,
605 include_dirs: [
606 "packages/modules/Bluetooth/system",
607 "packages/modules/Bluetooth/system/bta/include",
608 "packages/modules/Bluetooth/system/bta/test/common",
609 "packages/modules/Bluetooth/system/stack/include",
610 ],
611 srcs : [
Łukasz Rymanowskiaf2d9512022-01-20 22:23:14 +0000612 ":TestStubOsi",
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700613 ":TestMockBtaLeAudioHalVerifier",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000614 "gatt/database.cc",
615 "gatt/database_builder.cc",
616 "le_audio/client.cc",
617 "le_audio/client_parser.cc",
618 "le_audio/devices.cc",
619 "le_audio/le_audio_client_test.cc",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000620 "le_audio/le_audio_set_configuration_provider_json.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000621 "le_audio/le_audio_types.cc",
622 "le_audio/mock_iso_manager.cc",
623 "le_audio/mock_le_audio_client_audio.cc",
624 "le_audio/mock_state_machine.cc",
625 "test/common/btm_api_mock.cc",
626 "test/common/bta_gatt_api_mock.cc",
627 "test/common/bta_gatt_queue_mock.cc",
628 "test/common/btif_storage_mock.cc",
629 "test/common/mock_csis_client.cc",
630 "test/common/mock_controller.cc",
631 "test/common/mock_device_groups.cc",
Alice Kuo422f55d2021-12-30 11:33:32 +0800632 "le_audio/mock_codec_manager.cc",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000633 ],
634 shared_libs: [
Abhishek Pandit-Subedie4043892021-10-15 11:39:36 -0700635 "android.hardware.bluetooth.audio@2.0",
636 "android.hardware.bluetooth.audio@2.1",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000637 "libprotobuf-cpp-lite",
638 "libcrypto",
639 "liblog",
640 ],
641 static_libs : [
642 "crypto_toolbox_for_tests",
643 "libgmock",
644 "libbt-common",
645 "libbt-protos-lite",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000646 "libflatbuffers-cpp",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000647 "libosi",
Jakub Pawlowskid0a41af2022-01-03 17:53:02 +0100648 "liblc3",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000649 ],
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000650 data: [
651 ":audio_set_scenarios_bfbs",
652 ":audio_set_scenarios_json",
653 ":audio_set_configurations_bfbs",
654 ":audio_set_configurations_json",
655 ],
656 generated_headers: [
657 "LeAudioSetConfigSchemas_h",
658 ],
Josh Wu28d6da12021-12-22 06:13:40 -0800659 target: {
660 android: {
661 shared_libs: [
662 "libbinder_ndk",
663 "android.hardware.bluetooth.audio-V1-ndk",
664 ],
665 },
666 },
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000667 sanitize: {
668 cfi: true,
669 scs: true,
670 address: true,
671 all_undefined: true,
672 integer_overflow: true,
673 diag: {
674 undefined : true
675 },
676 },
677}
678
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100679cc_test {
680 name: "bluetooth_test_broadcaster_sm",
681 test_suites: ["device-tests"],
682 defaults: [
683 "fluoride_bta_defaults",
684 "clang_coverage_bin",
685 ],
686 host_supported: true,
687 include_dirs: [
688 "packages/modules/Bluetooth/system",
689 "packages/modules/Bluetooth/system/bta/include",
690 "packages/modules/Bluetooth/system/bta/le_audio",
691 "packages/modules/Bluetooth/system/btif/include",
692 "packages/modules/Bluetooth/system/stack/include",
693 "packages/modules/Bluetooth/system/stack/btm",
694 ],
695 srcs : [
696 "le_audio/broadcaster/broadcaster_types.cc",
697 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
698 "le_audio/broadcaster/state_machine.cc",
699 "le_audio/broadcaster/state_machine_test.cc",
700 "le_audio/le_audio_types.cc",
701 "le_audio/mock_iso_manager.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800702 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100703 ],
704 shared_libs: [
705 "libprotobuf-cpp-lite",
706 "libcrypto",
707 ],
708 static_libs : [
709 "libgmock",
710 "libbt-common",
711 "libbt-protos-lite",
712 "liblc3",
713 ],
714 sanitize: {
715 cfi: true,
716 scs: true,
717 address: true,
718 all_undefined: true,
719 integer_overflow: true,
720 diag: {
721 undefined : true
722 },
723 },
724}
725
726cc_test {
727 name: "bluetooth_test_broadcaster",
728 test_suites: ["device-tests"],
729 defaults: [
730 "fluoride_bta_defaults",
731 "clang_coverage_bin",
732 ],
733 host_supported: true,
734 include_dirs: [
735 "packages/modules/Bluetooth/system",
736 "packages/modules/Bluetooth/system/bta/include",
737 "packages/modules/Bluetooth/system/bta/le_audio",
738 "packages/modules/Bluetooth/system/bta/test/common",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100739 "packages/modules/Bluetooth/system/btif/include",
740 "packages/modules/Bluetooth/system/stack/include",
741 "packages/modules/Bluetooth/system/stack/btm",
742 ],
743 srcs : [
744 ":TestStubOsi",
745 "le_audio/broadcaster/broadcaster.cc",
746 "le_audio/broadcaster/broadcaster_test.cc",
747 "le_audio/broadcaster/broadcaster_types.cc",
748 "le_audio/broadcaster/mock_ble_advertising_manager.cc",
749 "le_audio/broadcaster/mock_state_machine.cc",
750 "le_audio/le_audio_types.cc",
751 "le_audio/mock_iso_manager.cc",
752 "le_audio/mock_le_audio_client_audio.cc",
753 "test/common/mock_controller.cc",
Patty0d8b97e2022-01-07 17:32:29 +0800754 "le_audio/mock_codec_manager.cc",
Jakub Tyszkowski86048262021-12-13 12:32:59 +0100755 ],
756 shared_libs: [
757 "libprotobuf-cpp-lite",
758 "libcrypto",
759 ],
760 static_libs : [
761 "libgmock",
762 "libbt-common",
763 "libbt-protos-lite",
764 "libosi",
765 "liblc3",
766 ],
767 sanitize: {
768 cfi: true,
769 scs: true,
770 address: true,
771 all_undefined: true,
772 integer_overflow: true,
773 diag: {
774 undefined : true
775 },
776 },
777}
Jakub Tyszkowskib87fc992021-04-08 15:08:35 +0000778
779cc_test {
780 name: "bluetooth_has_test",
781 test_suites: ["device-tests"],
782 defaults: [
783 "fluoride_bta_defaults",
784 "clang_coverage_bin",
785 ],
786 host_supported: true,
787 include_dirs: [
788 "packages/modules/Bluetooth/system",
789 "packages/modules/Bluetooth/system/bta/include",
790 "packages/modules/Bluetooth/system/bta/test/common",
791 "packages/modules/Bluetooth/system/stack/include",
792 ],
793 srcs : [
794 "gatt/database.cc",
795 "gatt/database_builder.cc",
796 "has/has_client.cc",
797 "has/has_client_test.cc",
798 "has/has_ctp.cc",
799 "has/has_journal.cc",
800 "has/has_preset.cc",
801 "has/has_types.cc",
802 "test/common/bta_gatt_api_mock.cc",
803 "test/common/bta_gatt_queue_mock.cc",
804 "test/common/btif_storage_mock.cc",
805 "test/common/btm_api_mock.cc",
806 "test/common/mock_controller.cc",
807 "test/common/mock_csis_client.cc",
808 ],
809 shared_libs: [
810 "libprotobuf-cpp-lite",
811 "libcrypto",
812 ],
813 static_libs : [
814 "crypto_toolbox_for_tests",
815 "libgmock",
816 "libbt-common",
817 "libbt-protos-lite",
818 ],
819 sanitize: {
820 cfi: true,
821 scs: true,
822 address: true,
823 all_undefined: true,
824 integer_overflow: true,
825 diag: {
826 undefined : true
827 },
828 },
829}