1package {
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    //   SPDX-license-identifier-BSD
8    default_applicable_licenses: ["system_bt_license"],
9}
10
11cc_library_static {
12    name: "libbt-btu-main-thread",
13    defaults: ["fluoride_defaults"],
14    srcs: ["btu/main_thread.cc"],
15    include_dirs: [
16        "packages/modules/Bluetooth/system",
17        "packages/modules/Bluetooth/system/gd",
18        "packages/modules/Bluetooth/system/include",
19        "packages/modules/Bluetooth/system/stack/include",
20    ],
21    static_libs: [
22        "libbluetooth_log",
23    ],
24    shared_libs: [
25        "libchrome",
26    ],
27    apex_available: [
28        "com.android.btservices",
29    ],
30    host_supported: true,
31    min_sdk_version: "Tiramisu",
32}
33
34// Bluetooth stack static library for target
35cc_library_static {
36    name: "libbt-stack",
37    defaults: ["fluoride_defaults"],
38    local_include_dirs: [
39        "ais",
40        "avct",
41        "avdt",
42        "avrc",
43        "bnep",
44        "btm",
45        "eatt",
46        "gap",
47        "gatt",
48        "hid",
49        "include",
50        "l2cap",
51        "metrics",
52        "pan",
53        "sdp",
54        "smp",
55        "srvc",
56    ],
57    header_libs: [
58        "libbluetooth_headers",
59    ],
60    include_dirs: [
61        "external/aac/libAACdec/include",
62        "external/aac/libAACenc/include",
63        "external/aac/libSYS/include",
64        "external/libldac/abr/inc",
65        "external/libldac/inc",
66        "external/libopus/include",
67        "packages/modules/Bluetooth/system",
68        "packages/modules/Bluetooth/system/bta/include",
69        "packages/modules/Bluetooth/system/bta/sys",
70        "packages/modules/Bluetooth/system/btif/include",
71        "packages/modules/Bluetooth/system/gd",
72        "packages/modules/Bluetooth/system/gd/hal",
73        "packages/modules/Bluetooth/system/udrv/include",
74    ],
75    srcs: [
76        "a2dp/a2dp_aac.cc",
77        "a2dp/a2dp_aac_decoder.cc",
78        "a2dp/a2dp_aac_encoder.cc",
79        "a2dp/a2dp_api.cc",
80        "a2dp/a2dp_codec_config.cc",
81        "a2dp/a2dp_ext.cc",
82        "a2dp/a2dp_sbc.cc",
83        "a2dp/a2dp_sbc_decoder.cc",
84        "a2dp/a2dp_sbc_encoder.cc",
85        "a2dp/a2dp_sbc_up_sample.cc",
86        "a2dp/a2dp_vendor.cc",
87        "a2dp/a2dp_vendor_aptx.cc",
88        "a2dp/a2dp_vendor_aptx_encoder.cc",
89        "a2dp/a2dp_vendor_aptx_hd.cc",
90        "a2dp/a2dp_vendor_aptx_hd_encoder.cc",
91        "a2dp/a2dp_vendor_ldac.cc",
92        "a2dp/a2dp_vendor_ldac_decoder.cc",
93        "a2dp/a2dp_vendor_ldac_encoder.cc",
94        "a2dp/a2dp_vendor_opus.cc",
95        "a2dp/a2dp_vendor_opus_decoder.cc",
96        "a2dp/a2dp_vendor_opus_encoder.cc",
97        "avct/avct_api.cc",
98        "avct/avct_bcb_act.cc",
99        "avct/avct_ccb.cc",
100        "avct/avct_l2c.cc",
101        "avct/avct_l2c_br.cc",
102        "avct/avct_lcb.cc",
103        "avct/avct_lcb_act.cc",
104        "avdt/avdt_ad.cc",
105        "avdt/avdt_api.cc",
106        "avdt/avdt_ccb.cc",
107        "avdt/avdt_ccb_act.cc",
108        "avdt/avdt_l2c.cc",
109        "avdt/avdt_msg.cc",
110        "avdt/avdt_scb.cc",
111        "avdt/avdt_scb_act.cc",
112        "avrc/avrc_api.cc",
113        "avrc/avrc_bld_ct.cc",
114        "avrc/avrc_bld_tg.cc",
115        "avrc/avrc_opt.cc",
116        "avrc/avrc_pars_ct.cc",
117        "avrc/avrc_pars_tg.cc",
118        "avrc/avrc_sdp.cc",
119        "avrc/avrc_utils.cc",
120        "bnep/bnep_api.cc",
121        "bnep/bnep_main.cc",
122        "bnep/bnep_utils.cc",
123        "btm/hfp_lc3_decoder.cc",
124        "btm/hfp_lc3_encoder.cc",
125        "btm/hfp_msbc_decoder.cc",
126        "btm/hfp_msbc_encoder.cc",
127        "hid/hidd_api.cc",
128        "hid/hidd_conn.cc",
129        "hid/hidh_api.cc",
130        "hid/hidh_conn.cc",
131        "pan/pan_api.cc",
132        "pan/pan_main.cc",
133        "pan/pan_utils.cc",
134    ],
135    static_libs: [
136        "bluetooth_flags_c_lib",
137        "libbluetooth_crypto_toolbox",
138        "libbluetooth_hci_pdl",
139        "libbluetooth_log",
140        "libbt-btu-main-thread",
141        "libbt-hci",
142        "libbt-platform-protos-lite",
143        "libbt-stack-core",
144        "liblc3",
145    ],
146    whole_static_libs: [
147        "libaptx_enc",
148        "libaptxhd_enc",
149        "libcom.android.sysprop.bluetooth.wrapped",
150        "libldacBT_abr",
151        "libldacBT_enc",
152    ],
153    apex_available: [
154        "com.android.btservices",
155    ],
156    host_supported: true,
157    min_sdk_version: "Tiramisu",
158}
159
160filegroup {
161    name: "LegacyStackSdp",
162    srcs: [
163        "sdp/sdp_api.cc",
164        "sdp/sdp_db.cc",
165        "sdp/sdp_discovery.cc",
166        "sdp/sdp_main.cc",
167        "sdp/sdp_server.cc",
168        "sdp/sdp_utils.cc",
169    ],
170}
171
172soong_config_module_type {
173    name: "hfp_hal_cc_defaults",
174    module_type: "cc_defaults",
175    config_namespace: "hfp_hal",
176    variables: ["vertical"],
177    properties: ["srcs"],
178}
179
180soong_config_string_variable {
181    name: "vertical",
182    values: [
183        "android_default",
184        "android_desktop",
185    ],
186}
187
188hfp_hal_cc_defaults {
189    name: "hfp_hal_defaults",
190    soong_config_variables: {
191        vertical: {
192            android_desktop: {
193                srcs: ["btm/btm_sco_hfp_hal_linux.cc"],
194            },
195            android_default: {
196                srcs: ["btm/btm_sco_hfp_hal.cc"],
197            },
198            conditions_default: {
199                srcs: ["btm/btm_sco_hfp_hal.cc"],
200            },
201        },
202    },
203}
204
205cc_library_static {
206    name: "libbt-stack-core",
207    defaults: [
208        "fluoride_defaults",
209        "hfp_hal_defaults",
210    ],
211    local_include_dirs: [
212        "ais",
213        "avct",
214        "avdt",
215        "avrc",
216        "bnep",
217        "btm",
218        "eatt",
219        "gap",
220        "gatt",
221        "hid",
222        "include",
223        "l2cap",
224        "metrics",
225        "pan",
226        "sdp",
227        "smp",
228        "srvc",
229    ],
230    header_libs: [
231        "libbluetooth_headers",
232    ],
233    include_dirs: [
234        "packages/modules/Bluetooth/system",
235        "packages/modules/Bluetooth/system/bta/ag",
236        "packages/modules/Bluetooth/system/bta/include",
237        "packages/modules/Bluetooth/system/bta/sys",
238        "packages/modules/Bluetooth/system/gd",
239        "packages/modules/Bluetooth/system/udrv/include",
240    ],
241    srcs: [
242        ":LegacyStackSdp",
243        "acl/acl.cc",
244        "acl/ble_acl.cc",
245        "acl/btm_acl.cc",
246        "acl/btm_pm.cc",
247        "ais/ais_ble.cc",
248        "arbiter/acl_arbiter.cc",
249        "btm/ble_scanner_hci_interface.cc",
250        "btm/btm_ble.cc",
251        "btm/btm_ble_addr.cc",
252        "btm/btm_ble_adv_filter.cc",
253        "btm/btm_ble_cont_energy.cc",
254        "btm/btm_ble_gap.cc",
255        "btm/btm_ble_privacy.cc",
256        "btm/btm_ble_scanner.cc",
257        "btm/btm_ble_sec.cc",
258        "btm/btm_client_interface.cc",
259        "btm/btm_dev.cc",
260        "btm/btm_devctl.cc",
261        "btm/btm_inq.cc",
262        "btm/btm_iot_config.cc",
263        "btm/btm_iso.cc",
264        "btm/btm_main.cc",
265        "btm/btm_sco.cc",
266        "btm/btm_sco_hci.cc",
267        "btm/btm_sec.cc",
268        "btm/btm_sec_cb.cc",
269        "btm/btm_security_client_interface.cc",
270        "btm/security_event_parser.cc",
271        "btu/btu_hcif.cc",
272        "connection_manager/connection_manager.cc",
273        "eatt/eatt.cc",
274        "gap/gap_ble.cc",
275        "gap/gap_conn.cc",
276        "gatt/att_protocol.cc",
277        "gatt/gatt_api.cc",
278        "gatt/gatt_attr.cc",
279        "gatt/gatt_auth.cc",
280        "gatt/gatt_cl.cc",
281        "gatt/gatt_db.cc",
282        "gatt/gatt_main.cc",
283        "gatt/gatt_sr.cc",
284        "gatt/gatt_sr_hash.cc",
285        "gatt/gatt_utils.cc",
286        "hcic/hciblecmds.cc",
287        "hcic/hcicmds.cc",
288        "l2cap/l2c_api.cc",
289        "l2cap/l2c_ble.cc",
290        "l2cap/l2c_ble_conn_params.cc",
291        "l2cap/l2c_csm.cc",
292        "l2cap/l2c_fcr.cc",
293        "l2cap/l2c_link.cc",
294        "l2cap/l2c_main.cc",
295        "l2cap/l2c_utils.cc",
296        "l2cap/l2cap_api.cc",
297        "metrics/stack_metrics_logging.cc",
298        "rfcomm/port_api.cc",
299        "rfcomm/port_rfc.cc",
300        "rfcomm/port_utils.cc",
301        "rfcomm/rfc_l2cap_if.cc",
302        "rfcomm/rfc_mx_fsm.cc",
303        "rfcomm/rfc_port_fsm.cc",
304        "rfcomm/rfc_port_if.cc",
305        "rfcomm/rfc_ts_frames.cc",
306        "rfcomm/rfc_utils.cc",
307        "rnr/remote_name_request.cc",
308        "smp/p_256_curvepara.cc",
309        "smp/p_256_ecc_pp.cc",
310        "smp/p_256_multprecision.cc",
311        "smp/smp_act.cc",
312        "smp/smp_api.cc",
313        "smp/smp_br_main.cc",
314        "smp/smp_keys.cc",
315        "smp/smp_l2c.cc",
316        "smp/smp_main.cc",
317        "smp/smp_utils.cc",
318        "srvc/srvc_dis.cc",
319        "srvc/srvc_eng.cc",
320    ],
321    generated_headers: [
322        "cxx-bridge-header",
323    ],
324    cflags: [
325        /* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
326        "-fvisibility=default",
327    ],
328    static_libs: [
329        "bluetooth_flags_c_lib",
330        "libaconfig_storage_read_api_cc",
331        "libbluetooth_core_rs",
332        "libbluetooth_crypto_toolbox",
333        "libbluetooth_gd",
334        "libbluetooth_hci_pdl",
335        "libbluetooth_log",
336        "libbt-hci",
337        "libbt-platform-protos-lite",
338        "libcom.android.sysprop.bluetooth.wrapped",
339        "server_configurable_flags",
340    ],
341    shared_libs: [
342        "libPlatformProperties",
343        "libcrypto",
344    ],
345    apex_available: [
346        "com.android.btservices",
347    ],
348    host_supported: true,
349    min_sdk_version: "Tiramisu",
350}
351
352cc_defaults {
353    name: "btstack_fuzzer_default",
354    host_supported: true,
355    defaults: [
356        "bluetooth_cflags",
357    ],
358    include_dirs: [
359        "packages/modules/Bluetooth/system",
360        "packages/modules/Bluetooth/system/gd",
361        "packages/modules/Bluetooth/system/include",
362        "packages/modules/Bluetooth/system/stack/include",
363        "packages/modules/Bluetooth/system/test/common",
364    ],
365    static_libs: [
366        "libchrome",
367        "libgmock",
368        "libgtest",
369    ],
370    shared_libs: [
371        "libbase",
372        "liblog",
373    ],
374    target: {
375        darwin: {
376            enabled: false,
377        },
378        android: {
379            shared_libs: [
380                "libcutils",
381                "libutils",
382            ],
383        },
384        host: {
385            cflags: [
386                "-DOS_GENERIC",
387            ],
388        },
389    },
390    fuzz_config: {
391        // Options for performance improvement
392        libfuzzer_options: [
393            // This disables the stdout and stderr
394            "close_fd_mask=3",
395            // This limits the maximum corpus size to 4KB
396            "max_len=4096",
397            // TODO: b/280300628 for fixing memory leaks. Until it's fixed leak
398            // detection needs to be turned off to unblock fuzzing.
399            "detect_leaks=0",
400        ],
401        cc: [
402            "[email protected]",
403            "[email protected]",
404        ],
405        componentid: 27441, // Android > Android OS & Apps > Systems > bluetooth
406        hotlists: [
407            "3705175", // ASA Red Team Discovered Issues
408            "4810445", // ASA Red Team: Bluetooth Engagement Issues
409        ],
410        acknowledgement: [
411            "Android Bluetooth Team of Google",
412            "Android Red Team of Google",
413        ],
414    },
415}
416
417cc_fuzz {
418    name: "sdp-fuzzer",
419    defaults: [
420        "btstack_fuzzer_default",
421        "fluoride_defaults",
422    ],
423    include_dirs: [
424        "packages/modules/Bluetooth/system/stack/btm",
425    ],
426    srcs: [
427        ":LegacyStackSdp",
428        ":TestCommonMockFunctions",
429        ":TestFakeOsi",
430        ":TestMockBtif",
431        ":TestMockDevice",
432        ":TestMockStackBtm",
433        ":TestMockStackL2cap",
434        ":TestMockStackMetrics",
435        "fuzzers/sdp_fuzzer.cc",
436    ],
437    static_libs: [
438        "bluetooth_flags_c_lib",
439        "libbluetooth-types",
440        "libbluetooth_hci_pdl",
441        "libbluetooth_log",
442        "libbt-platform-protos-lite",
443    ],
444    shared_libs: [
445        "libaconfig_storage_read_api_cc",
446        "server_configurable_flags",
447    ],
448}
449
450cc_fuzz {
451    name: "rfcomm-fuzzer",
452    team: "trendy_team_attack_tools",
453    defaults: [
454        "btstack_fuzzer_default",
455        "fluoride_defaults",
456    ],
457    include_dirs: [
458        "external/flatbuffers/include",
459        "external/rust/crates/quiche/deps/boringssl/src/include",
460        "packages/modules/Bluetooth/system/stack/btm",
461        "packages/modules/Bluetooth/system/stack/test/common",
462        "packages/modules/Bluetooth/system/stack/test/rfcomm",
463    ],
464    srcs: [
465        ":BluetoothPacketSources",
466        ":TestCommonMockFunctions",
467        ":TestCommonStackConfig",
468        ":TestFakeOsi",
469        ":TestMockBtif",
470        ":TestMockDevice",
471        ":TestMockMainShim",
472        ":TestMockMainShimEntry",
473        ":TestMockRustFfi",
474        ":TestMockSrvcDis",
475        ":TestMockStackAcl",
476        ":TestMockStackArbiter",
477        ":TestMockStackBtm",
478        ":TestMockStackHcic",
479        ":TestMockStackL2cap",
480        ":TestMockStackMetrics",
481        ":TestMockStackSdp",
482        "fuzzers/rfcomm_fuzzer.cc",
483        "rfcomm/*.cc",
484        "test/common/stack_test_packet_utils.cc",
485        "test/rfcomm/stack_rfcomm_test_utils.cc",
486    ],
487    shared_libs: [
488        "server_configurable_flags",
489    ],
490    static_libs: [
491        "bluetooth_flags_c_lib",
492        "libaconfig_storage_read_api_cc",
493        "libbluetooth-types",
494        "libbluetooth_core_rs_bridge",
495        "libbluetooth_crypto_toolbox",
496        "libbluetooth_hci_pdl",
497        "libbluetooth_l2cap_pdl",
498        "libbluetooth_log",
499        "libbluetooth_smp_pdl",
500        "libbt-platform-protos-lite",
501    ],
502}
503
504cc_fuzz {
505    name: "gatt-fuzzer",
506    defaults: [
507        "btstack_fuzzer_default",
508        "fluoride_defaults",
509    ],
510    include_dirs: [
511        "external/flatbuffers/include",
512        "external/rust/crates/quiche/deps/boringssl/src/include",
513        "packages/modules/Bluetooth/system/stack/btm",
514    ],
515    srcs: [
516        ":BluetoothPacketSources",
517        ":TestCommonMockFunctions",
518        ":TestCommonStackConfig",
519        ":TestFakeOsi",
520        ":TestMockBtif",
521        ":TestMockDevice",
522        ":TestMockMainShim",
523        ":TestMockMainShimEntry",
524        ":TestMockRustFfi",
525        ":TestMockSrvcDis",
526        ":TestMockStackAcl",
527        ":TestMockStackArbiter",
528        ":TestMockStackBtm",
529        ":TestMockStackConnMgr",
530        ":TestMockStackHcic",
531        ":TestMockStackL2cap",
532        ":TestMockStackMetrics",
533        ":TestMockStackSdp",
534        "ais/*.cc",
535        "eatt/*.cc",
536        "fuzzers/gatt_fuzzer.cc",
537        "gatt/*.cc",
538    ],
539    shared_libs: [
540        "libaconfig_storage_read_api_cc",
541        "server_configurable_flags",
542    ],
543    static_libs: [
544        "bluetooth_flags_c_lib",
545        "libbluetooth-types",
546        "libbluetooth_core_rs_bridge",
547        "libbluetooth_crypto_toolbox",
548        "libbluetooth_hci_pdl",
549        "libbluetooth_l2cap_pdl",
550        "libbluetooth_log",
551        "libbluetooth_smp_pdl",
552        "libbt-platform-protos-lite",
553    ],
554}
555
556cc_fuzz {
557    name: "smp-fuzzer",
558    defaults: [
559        "btstack_fuzzer_default",
560        "fluoride_defaults",
561    ],
562    include_dirs: [
563        "external/flatbuffers/include",
564        "external/rust/crates/quiche/deps/boringssl/src/include",
565        "packages/modules/Bluetooth/system/stack/btm",
566    ],
567    srcs: [
568        ":BluetoothPacketSources",
569        ":TestCommonMockFunctions",
570        ":TestCommonStackConfig",
571        ":TestFakeOsi",
572        ":TestMockBtif",
573        ":TestMockDevice",
574        ":TestMockMainShim",
575        ":TestMockMainShimEntry",
576        ":TestMockStackAcl",
577        ":TestMockStackBtm",
578        ":TestMockStackHcic",
579        ":TestMockStackL2cap",
580        ":TestMockStackMetrics",
581        "fuzzers/smp_fuzzer.cc",
582        "smp/*.cc", // add other sources files  (p256 related) under smp into this test
583    ],
584    shared_libs: [
585        "libaconfig_storage_read_api_cc",
586        "server_configurable_flags",
587    ],
588    static_libs: [
589        "bluetooth_flags_c_lib",
590        "libbluetooth-types",
591        "libbluetooth_crypto_toolbox",
592        "libbluetooth_hci_pdl",
593        "libbluetooth_l2cap_pdl",
594        "libbluetooth_log",
595        "libbluetooth_smp_pdl",
596        "libbt-common",
597        "libbt-platform-protos-lite",
598        "libevent",
599    ],
600}
601
602cc_fuzz {
603    name: "bnep-fuzzer",
604    defaults: [
605        "btstack_fuzzer_default",
606        "fluoride_defaults",
607    ],
608    include_dirs: [
609        "external/flatbuffers/include",
610        "external/rust/crates/quiche/deps/boringssl/src/include",
611        "packages/modules/Bluetooth/system/stack/btm",
612    ],
613    srcs: [
614        ":BluetoothPacketSources",
615        ":TestCommonMockFunctions",
616        ":TestCommonStackConfig",
617        ":TestFakeOsi",
618        ":TestMockBtif",
619        ":TestMockDevice",
620        ":TestMockMainShim",
621        ":TestMockMainShimEntry",
622        ":TestMockStackAcl",
623        ":TestMockStackBtm",
624        ":TestMockStackHcic",
625        ":TestMockStackL2cap",
626        ":TestMockStackMetrics",
627        "bnep/*.cc",
628        "fuzzers/bnep_fuzzer.cc",
629    ],
630    static_libs: [
631        "libbluetooth-types",
632        "libbluetooth_hci_pdl",
633        "libbluetooth_l2cap_pdl",
634        "libbluetooth_log",
635        "libbluetooth_smp_pdl",
636        "libbt-platform-protos-lite",
637    ],
638}
639
640cc_fuzz {
641    name: "avrc-fuzzer",
642    defaults: [
643        "btstack_fuzzer_default",
644        "fluoride_defaults",
645    ],
646    include_dirs: [
647        "external/flatbuffers/include",
648        "external/rust/crates/quiche/deps/boringssl/src/include",
649        "packages/modules/Bluetooth/system/stack/btm",
650    ],
651    srcs: [
652        ":BluetoothPacketSources",
653        ":TestCommonMockFunctions",
654        ":TestCommonStackConfig",
655        ":TestFakeOsi",
656        ":TestMockBtif",
657        ":TestMockDevice",
658        ":TestMockMainShim",
659        ":TestMockMainShimEntry",
660        ":TestMockStackAcl",
661        ":TestMockStackBtm",
662        ":TestMockStackHcic",
663        ":TestMockStackL2cap",
664        ":TestMockStackMetrics",
665        ":TestMockStackSdp",
666        "avct/*.cc",
667        "avrc/*.cc",
668        "fuzzers/avrc_fuzzer.cc",
669    ],
670    shared_libs: [
671        "libaconfig_storage_read_api_cc",
672        "server_configurable_flags",
673    ],
674    static_libs: [
675        "bluetooth_flags_c_lib",
676        "libbase",
677        "libbluetooth-types",
678        "libbluetooth_hci_pdl",
679        "libbluetooth_l2cap_pdl",
680        "libbluetooth_log",
681        "libbluetooth_smp_pdl",
682        "libbt-platform-protos-lite",
683        "libcom.android.sysprop.bluetooth.wrapped",
684    ],
685}
686
687cc_fuzz {
688    name: "l2cap-fuzzer",
689    defaults: [
690        "btstack_fuzzer_default",
691        "fluoride_defaults",
692    ],
693    include_dirs: [
694        "external/flatbuffers/include",
695        "external/rust/crates/quiche/deps/boringssl/src/include",
696        "packages/modules/Bluetooth/system/stack/btm",
697    ],
698    srcs: [
699        ":BluetoothPacketSources",
700        ":TestCommonMockFunctions",
701        ":TestCommonStackConfig",
702        ":TestFakeOsi",
703        ":TestMockBtif",
704        ":TestMockDevice",
705        ":TestMockMainShim",
706        ":TestMockMainShimEntry",
707        ":TestMockStackAcl",
708        ":TestMockStackBtm",
709        ":TestMockStackHcic",
710        ":TestMockStackMetrics",
711        "fuzzers/l2cap_fuzzer.cc",
712        "l2cap/*.cc",
713    ],
714    static_libs: [
715        "bluetooth_flags_c_lib",
716        "libbluetooth-types",
717        "libbluetooth_hci_pdl",
718        "libbluetooth_l2cap_pdl",
719        "libbluetooth_log",
720        "libbluetooth_smp_pdl",
721        "libbt-platform-protos-lite",
722    ],
723    shared_libs: [
724        "libaconfig_storage_read_api_cc",
725        "libbase",
726        "liblog",
727        "server_configurable_flags",
728    ],
729    target: {
730        android: {
731            shared_libs: [
732                "libPlatformProperties",
733            ],
734        },
735    },
736}
737
738// Bluetooth stack unit tests for target
739cc_test {
740    name: "net_test_stack",
741    defaults: [
742        "fluoride_defaults",
743        "latest_android_hardware_audio_common_ndk_static",
744        "latest_android_hardware_bluetooth_audio_ndk_static",
745        "latest_android_media_audio_common_types_ndk_static",
746        "mts_defaults",
747    ],
748    test_suites: ["general-tests"],
749    local_include_dirs: [
750        "include",
751    ],
752    include_dirs: [
753        "packages/modules/Bluetooth/system",
754        "packages/modules/Bluetooth/system/gd",
755    ],
756    srcs: [
757        "test/gatt/gatt_api_test.cc",
758        "test/stack_a2dp_test.cc",
759        "test/stack_avrcp_test.cc",
760    ],
761    shared_libs: [
762        "libPlatformProperties",
763        "libaaudio",
764        "libaconfig_storage_read_api_cc",
765        "libbase",
766        "libcrypto",
767        "libcutils",
768        "libdl",
769        "libevent",
770        "libhidlbase",
771        "liblog",
772        "libstatssocket",
773        "libutils",
774        "libz",
775        "server_configurable_flags",
776    ],
777    static_libs: [
778        "[email protected]",
779        "[email protected]",
780        "[email protected]",
781        "android.hardware.common-V2-ndk",
782        "android.hardware.common.fmq-V1-ndk",
783        "android.system.suspend-V1-ndk",
784        "android.system.suspend.control-V1-ndk",
785        "bluetooth_flags_c_lib_for_test",
786        "libFraunhoferAAC",
787        "libbase",
788        "libbluetooth-for-tests",
789        "libbluetooth-types",
790        "libbluetooth_core_rs",
791        "libbluetooth_crypto_toolbox",
792        "libbluetooth_log",
793        "libbt-audio-hal-interface",
794        "libbt-bta",
795        "libbt-bta-core",
796        "libbt-btu-main-thread",
797        "libbt-common",
798        "libbt-hci",
799        "libbt-jni-thread",
800        "libbt-sbc-decoder",
801        "libbt-sbc-encoder",
802        "libbt-stack",
803        "libbt-stack-core",
804        "libbtcore",
805        "libbtdevice",
806        "libbtif",
807        "libbtif-core",
808        "libchrome",
809        "libcom.android.sysprop.bluetooth.wrapped",
810        "libflags_rust_cpp_bridge",
811        "libfmq",
812        "libg722codec",
813        "liblc3",
814        "libopus",
815        "libosi",
816        "libprotobuf-cpp-lite",
817        "libstatslog_bt",
818        "libudrv-uipc",
819    ],
820    target: {
821        android: {
822            shared_libs: [
823                "libbinder_ndk",
824            ],
825            static_libs: [
826                "[email protected]",
827                "[email protected]",
828                "libexpresslog",
829                "libstatslog_express",
830                "libtextclassifier_hash_static",
831            ],
832        },
833        host: {
834            static_libs: [
835                "libbinder_ndk",
836            ],
837        },
838    },
839    header_libs: ["libbluetooth_headers"],
840}
841
842cc_test {
843    name: "net_test_stack_rfcomm",
844    defaults: [
845        "fluoride_defaults",
846        "mts_defaults",
847    ],
848    test_suites: ["general-tests"],
849    host_supported: true,
850    local_include_dirs: [
851        "btm",
852        "include",
853        "l2cap",
854        "rfcomm",
855        "smp",
856        "test/common",
857    ],
858    include_dirs: [
859        "packages/modules/Bluetooth/system",
860        "packages/modules/Bluetooth/system/gd",
861        "packages/modules/Bluetooth/system/gd/hal",
862    ],
863    srcs: [
864        ":TestCommonMockFunctions",
865        ":TestMockHci",
866        ":TestMockMainShim",
867        ":TestMockMainShimEntry",
868        ":TestMockStackBtm",
869        ":TestMockStackL2capInterface",
870        ":TestMockStackMetrics",
871        "rfcomm/port_api.cc",
872        "rfcomm/port_rfc.cc",
873        "rfcomm/port_utils.cc",
874        "rfcomm/rfc_l2cap_if.cc",
875        "rfcomm/rfc_mx_fsm.cc",
876        "rfcomm/rfc_port_fsm.cc",
877        "rfcomm/rfc_port_if.cc",
878        "rfcomm/rfc_ts_frames.cc",
879        "rfcomm/rfc_utils.cc",
880        "test/common/mock_btm_layer.cc",
881        "test/common/mock_l2cap_layer.cc",
882        "test/common/stack_test_packet_utils.cc",
883        "test/rfcomm/stack_rfcomm_port_test.cc",
884        "test/rfcomm/stack_rfcomm_test.cc",
885        "test/rfcomm/stack_rfcomm_test_main.cc",
886        "test/rfcomm/stack_rfcomm_test_utils.cc",
887        "test/rfcomm/stack_rfcomm_test_utils_test.cc",
888    ],
889    shared_libs: [
890        "libcrypto",
891        "libcutils",
892    ],
893    static_libs: [
894        "bluetooth_flags_c_lib_for_test",
895        "libaconfig_storage_read_api_cc",
896        "libbase",
897        "libbluetooth-types",
898        "libbluetooth_crypto_toolbox",
899        "libbluetooth_gd",
900        "libbluetooth_hci_pdl",
901        "libbluetooth_l2cap_pdl",
902        "libbluetooth_log",
903        "libbluetooth_smp_pdl",
904        "libbt-btu-main-thread",
905        "libbt-common",
906        "libbt-platform-protos-lite",
907        "libchrome",
908        "libcom.android.sysprop.bluetooth.wrapped",
909        "libevent",
910        "libgmock",
911        "liblog",
912        "libosi",
913        "libprotobuf-cpp-lite",
914        "libstatslog_bt",
915        "server_configurable_flags",
916    ],
917    target: {
918        android: {
919            shared_libs: [
920                "libstatssocket",
921            ],
922        },
923    },
924    sanitize: {
925        cfi: false,
926    },
927    header_libs: ["libbluetooth_headers"],
928}
929
930// Bluetooth stack smp unit tests for target
931cc_test {
932    name: "net_test_stack_smp",
933    defaults: [
934        "fluoride_defaults",
935        "mts_defaults",
936    ],
937    host_supported: true,
938    test_suites: ["general-tests"],
939    local_include_dirs: [
940        "btm",
941        "include",
942        "l2cap",
943        "smp",
944    ],
945    include_dirs: [
946        "packages/modules/Bluetooth/system",
947        "packages/modules/Bluetooth/system/gd",
948        "packages/modules/Bluetooth/system/include",
949    ],
950    srcs: [
951        ":TestCommonMainHandler",
952        ":TestCommonMockFunctions",
953        ":TestMockBtif",
954        ":TestMockDevice",
955        ":TestMockMainShim",
956        ":TestMockMainShimEntry",
957        ":TestMockStackAcl",
958        ":TestMockStackBtm",
959        ":TestMockStackHcic",
960        ":TestMockStackL2cap",
961        ":TestMockStackMetrics",
962        "smp/p_256_curvepara.cc",
963        "smp/p_256_ecc_pp.cc",
964        "smp/p_256_multprecision.cc",
965        "smp/smp_act.cc",
966        "smp/smp_api.cc",
967        "smp/smp_br_main.cc",
968        "smp/smp_keys.cc",
969        "smp/smp_l2c.cc",
970        "smp/smp_main.cc",
971        "smp/smp_utils.cc",
972        "test/stack_smp_test.cc",
973    ],
974    shared_libs: [
975        "libaconfig_storage_read_api_cc",
976        "libcrypto",
977        "libcutils",
978        "server_configurable_flags",
979    ],
980    static_libs: [
981        "bluetooth_flags_c_lib_for_test",
982        "libbase",
983        "libbluetooth-types",
984        "libbluetooth_crypto_toolbox",
985        "libbluetooth_gd",
986        "libbluetooth_hci_pdl",
987        "libbluetooth_l2cap_pdl",
988        "libbluetooth_log",
989        "libbluetooth_smp_pdl",
990        "libbt-btu-main-thread",
991        "libbt-common",
992        "libbt-platform-protos-lite",
993        "libchrome",
994        "libcom.android.sysprop.bluetooth.wrapped",
995        "libevent",
996        "libgmock",
997        "liblog",
998        "libosi",
999        "libstatslog_bt",
1000    ],
1001    target: {
1002        android: {
1003            shared_libs: [
1004                "libstatssocket",
1005            ],
1006        },
1007    },
1008}
1009
1010// Bluetooth stack advertise data parsing unit tests for target
1011cc_test {
1012    name: "net_test_stack_ad_parser",
1013    defaults: [
1014        "fluoride_defaults",
1015        "mts_defaults",
1016    ],
1017    test_suites: ["general-tests"],
1018    local_include_dirs: [
1019        "include",
1020    ],
1021    srcs: [
1022        "test/ad_parser_unittest.cc",
1023    ],
1024    shared_libs: [
1025        "libbinder_ndk",
1026        "libcrypto",
1027    ],
1028    static_libs: [
1029        "android.system.suspend.control-V1-ndk",
1030        "libbluetooth-types",
1031        "libbluetooth_log",
1032        "libgmock",
1033        "liblog",
1034    ],
1035}
1036
1037// Bluetooth stack connection multiplexing
1038cc_test {
1039    name: "net_test_conn_multiplexing",
1040    defaults: [
1041        "fluoride_defaults",
1042        "mts_defaults",
1043    ],
1044    host_supported: true,
1045    test_suites: ["general-tests"],
1046    local_include_dirs: [
1047        "btm",
1048        "include",
1049        "test/common",
1050    ],
1051    include_dirs: [
1052        "packages/modules/Bluetooth/system",
1053        "packages/modules/Bluetooth/system/gd",
1054    ],
1055    srcs: [
1056        ":TestCommonMainHandler",
1057        ":TestMockStackBtmInterface",
1058        "connection_manager/connection_manager.cc",
1059        "test/common/mock_btm_api_layer.cc",
1060        "test/connection_manager_test.cc",
1061    ],
1062    shared_libs: [
1063        "libcutils",
1064    ],
1065    static_libs: [
1066        "libbase",
1067        "libbluetooth-types",
1068        "libbluetooth_gd",
1069        "libbluetooth_log",
1070        "libbt-common",
1071        "libchrome",
1072        "libevent",
1073        "libgmock",
1074        "liblog",
1075    ],
1076    sanitize: {
1077        cfi: false,
1078    },
1079    header_libs: ["libbluetooth_headers"],
1080}
1081
1082cc_test {
1083    name: "net_test_stack_gatt_native",
1084    defaults: [
1085        "fluoride_defaults",
1086        "mts_defaults",
1087    ],
1088    test_suites: ["general-tests"],
1089    host_supported: true,
1090    test_options: {
1091        unit_test: true,
1092    },
1093    include_dirs: [
1094        "packages/modules/Bluetooth/system",
1095        "packages/modules/Bluetooth/system/gd",
1096        "packages/modules/Bluetooth/system/stack/btm",
1097        "packages/modules/Bluetooth/system/stack/eatt",
1098        "packages/modules/Bluetooth/system/stack/include",
1099        "packages/modules/Bluetooth/system/stack/l2cap",
1100    ],
1101    srcs: [
1102        ":TestCommonMockFunctions",
1103        ":TestMockMainShim",
1104        ":TestMockRustFfi",
1105        ":TestMockStackArbiter",
1106        ":TestMockStackBtm",
1107        ":TestMockStackSdp",
1108        "gatt/gatt_utils.cc",
1109        "test/common/mock_eatt.cc",
1110        "test/common/mock_gatt_layer.cc",
1111        "test/gatt/gatt_sr_test.cc",
1112    ],
1113    shared_libs: [
1114        "libaconfig_storage_read_api_cc",
1115        "libcrypto",
1116        "libcutils",
1117        "server_configurable_flags",
1118    ],
1119    static_libs: [
1120        "bluetooth_flags_c_lib_for_test",
1121        "libbase",
1122        "libbluetooth-types",
1123        "libbluetooth_core_rs_bridge",
1124        "libbluetooth_crypto_toolbox",
1125        "libbluetooth_gd",
1126        "libbluetooth_log",
1127        "libbt-common",
1128        "libbt-platform-protos-lite",
1129        "libchrome",
1130        "libcom.android.sysprop.bluetooth.wrapped",
1131        "libevent",
1132        "libgmock",
1133        "liblog",
1134        "libosi",
1135        "libstatslog_bt",
1136    ],
1137    target: {
1138        android: {
1139            shared_libs: [
1140                "libstatssocket",
1141            ],
1142        },
1143    },
1144    sanitize: {
1145        address: true,
1146        cfi: true,
1147        misc_undefined: ["bounds"],
1148    },
1149    header_libs: ["libbluetooth_headers"],
1150}
1151
1152cc_test {
1153    name: "net_test_stack_avctp",
1154    defaults: [
1155        "fluoride_defaults",
1156        "mts_defaults",
1157    ],
1158    test_suites: ["general-tests"],
1159    host_supported: true,
1160    test_options: {
1161        unit_test: true,
1162    },
1163    include_dirs: [
1164        "external/libldac/inc",
1165        "packages/modules/Bluetooth/system",
1166        "packages/modules/Bluetooth/system/gd",
1167        "packages/modules/Bluetooth/system/stack/include",
1168    ],
1169    srcs: [
1170        ":TestCommonMockFunctions",
1171        ":TestFakeOsi",
1172        ":TestMockBta",
1173        ":TestMockBtif",
1174        ":TestMockDevice",
1175        ":TestMockStackA2dp",
1176        ":TestMockStackAcl",
1177        ":TestMockStackL2cap",
1178        "avct/avct_api.cc",
1179        "avct/avct_bcb_act.cc",
1180        "avct/avct_ccb.cc",
1181        "avct/avct_l2c.cc",
1182        "avct/avct_l2c_br.cc",
1183        "avct/avct_lcb.cc",
1184        "avct/avct_lcb_act.cc",
1185        "test/stack_avctp_test.cc",
1186    ],
1187    aidl: {
1188        libs: ["bluetooth_constants"],
1189    },
1190    shared_libs: [
1191        "libbinder",
1192        "libcrypto",
1193        "libcutils",
1194        "server_configurable_flags",
1195    ],
1196    static_libs: [
1197        "bluetooth_flags_c_lib_for_test",
1198        "libaconfig_storage_read_api_cc",
1199        "libbase",
1200        "libbluetooth-types",
1201        "libbluetooth_crypto_toolbox",
1202        "libbluetooth_gd",
1203        "libbluetooth_log",
1204        "libbt-common",
1205        "libchrome",
1206        "libcom.android.sysprop.bluetooth.wrapped",
1207        "libevent",
1208        "libgmock",
1209        "liblog",
1210        "libosi",
1211        "libprotobuf-cpp-lite",
1212        "libstatslog_bt",
1213    ],
1214    target: {
1215        android: {
1216            shared_libs: ["libstatssocket"],
1217        },
1218    },
1219    sanitize: {
1220        address: true,
1221        cfi: true,
1222        misc_undefined: ["bounds"],
1223    },
1224    header_libs: ["libbluetooth_headers"],
1225}
1226
1227cc_test {
1228    name: "net_test_stack_avdtp",
1229    defaults: [
1230        "fluoride_defaults",
1231        "mts_defaults",
1232    ],
1233    test_suites: ["general-tests"],
1234    host_supported: true,
1235    test_options: {
1236        unit_test: true,
1237    },
1238    include_dirs: [
1239        "external/libldac/inc",
1240        "packages/modules/Bluetooth/system",
1241        "packages/modules/Bluetooth/system/gd",
1242        "packages/modules/Bluetooth/system/stack/include",
1243    ],
1244    srcs: [
1245        ":TestCommonMockFunctions",
1246        ":TestMockBta",
1247        ":TestMockDevice",
1248        ":TestMockStackA2dp",
1249        ":TestMockStackAcl",
1250        ":TestMockStackL2cap",
1251        "avdt/avdt_ad.cc",
1252        "avdt/avdt_api.cc",
1253        "avdt/avdt_ccb.cc",
1254        "avdt/avdt_ccb_act.cc",
1255        "avdt/avdt_l2c.cc",
1256        "avdt/avdt_scb.cc",
1257        "avdt/avdt_scb_act.cc",
1258        "test/common/mock_btu_layer.cc",
1259        "test/common/mock_stack_avdt_msg.cc",
1260        "test/stack_avdtp_test.cc",
1261    ],
1262    aidl: {
1263        libs: ["bluetooth_constants"],
1264    },
1265    shared_libs: [
1266        "libbinder",
1267        "libcrypto",
1268        "libcutils",
1269        "server_configurable_flags",
1270    ],
1271    static_libs: [
1272        "bluetooth_flags_c_lib_for_test",
1273        "libaconfig_storage_read_api_cc",
1274        "libbase",
1275        "libbluetooth-types",
1276        "libbluetooth_crypto_toolbox",
1277        "libbluetooth_gd",
1278        "libbluetooth_log",
1279        "libbt-common",
1280        "libchrome",
1281        "libcom.android.sysprop.bluetooth.wrapped",
1282        "libevent",
1283        "libgmock",
1284        "liblog",
1285        "libosi",
1286        "libprotobuf-cpp-lite",
1287        "libstatslog_bt",
1288    ],
1289    target: {
1290        android: {
1291            shared_libs: ["libstatssocket"],
1292        },
1293    },
1294    sanitize: {
1295        address: true,
1296        cfi: true,
1297        misc_undefined: ["bounds"],
1298    },
1299    header_libs: ["libbluetooth_headers"],
1300}
1301
1302cc_test {
1303    name: "net_test_stack_a2dp_codecs_native",
1304    defaults: [
1305        "fluoride_defaults",
1306        "mts_defaults",
1307    ],
1308    cflags: [
1309        "-DUNIT_TESTS",
1310    ],
1311    test_suites: ["general-tests"],
1312    host_supported: true,
1313    test_options: {
1314        unit_test: true,
1315    },
1316    include_dirs: [
1317        "external/aac/libAACdec/include",
1318        "external/aac/libAACenc/include",
1319        "external/aac/libSYS/include",
1320        "external/libldac/abr/inc",
1321        "external/libldac/inc",
1322        "external/libopus/include",
1323        "packages/modules/Bluetooth/system",
1324        "packages/modules/Bluetooth/system/embdrv/encoder_for_aptxhd/include",
1325        "packages/modules/Bluetooth/system/gd",
1326        "packages/modules/Bluetooth/system/stack/include",
1327    ],
1328    target: {
1329        android: {
1330            test_config: "test/a2dp/AndroidTest.xml",
1331        },
1332        android_x86: {
1333            test_config: "test/a2dp/AndroidTestForce32.xml",
1334        },
1335    },
1336    data: [
1337        "test/a2dp/raw_data/*",
1338    ],
1339    srcs: [
1340        ":TestCommonMockFunctions",
1341        ":TestMockAudioHalInterface",
1342        ":TestMockBta",
1343        ":TestMockStackA2dpApi",
1344        "a2dp/a2dp_aac.cc",
1345        "a2dp/a2dp_aac_decoder.cc",
1346        "a2dp/a2dp_aac_encoder.cc",
1347        "a2dp/a2dp_codec_config.cc",
1348        "a2dp/a2dp_ext.cc",
1349        "a2dp/a2dp_sbc.cc",
1350        "a2dp/a2dp_sbc_decoder.cc",
1351        "a2dp/a2dp_sbc_encoder.cc",
1352        "a2dp/a2dp_sbc_up_sample.cc",
1353        "a2dp/a2dp_vendor.cc",
1354        "a2dp/a2dp_vendor_aptx.cc",
1355        "a2dp/a2dp_vendor_aptx_encoder.cc",
1356        "a2dp/a2dp_vendor_aptx_hd.cc",
1357        "a2dp/a2dp_vendor_aptx_hd_encoder.cc",
1358        "a2dp/a2dp_vendor_ldac.cc",
1359        "a2dp/a2dp_vendor_ldac_decoder.cc",
1360        "a2dp/a2dp_vendor_ldac_encoder.cc",
1361        "a2dp/a2dp_vendor_opus.cc",
1362        "a2dp/a2dp_vendor_opus_decoder.cc",
1363        "a2dp/a2dp_vendor_opus_encoder.cc",
1364        "test/a2dp/a2dp_aac_unittest.cc",
1365        "test/a2dp/a2dp_opus_unittest.cc",
1366        "test/a2dp/a2dp_sbc_regression_tests.cc",
1367        "test/a2dp/a2dp_sbc_unittest.cc",
1368        "test/a2dp/a2dp_vendor_ldac_unittest.cc",
1369        "test/a2dp/a2dp_vendor_regression_tests.cc",
1370        "test/a2dp/media_codec_capabilities_test.cc",
1371        "test/a2dp/mock_bta_av_codec.cc",
1372        "test/a2dp/test_util.cc",
1373        "test/a2dp/wav_reader.cc",
1374        "test/a2dp/wav_reader_unittest.cc",
1375    ],
1376    aidl: {
1377        libs: ["bluetooth_constants"],
1378    },
1379    shared_libs: [
1380        "libbinder",
1381        "libcrypto",
1382        "libcutils",
1383        "libprotobuf-cpp-lite",
1384    ],
1385    static_libs: [
1386        "libFraunhoferAAC",
1387        "libbase",
1388        "libbluetooth-types",
1389        "libbluetooth_crypto_toolbox",
1390        "libbluetooth_gd",
1391        "libbluetooth_log",
1392        "libbt-common",
1393        "libbt-sbc-decoder",
1394        "libbt-sbc-encoder",
1395        "libchrome",
1396        "libcom.android.sysprop.bluetooth.wrapped",
1397        "libgmock",
1398        "liblog",
1399        "libopus",
1400        "libosi",
1401    ],
1402    whole_static_libs: [
1403        "libaptx_enc",
1404        "libaptxhd_enc",
1405        "libldacBT_abr",
1406        "libldacBT_enc",
1407    ],
1408    sanitize: {
1409        address: true,
1410        cfi: true,
1411        misc_undefined: ["bounds"],
1412    },
1413    header_libs: ["libbluetooth_headers"],
1414}
1415
1416cc_test {
1417    name: "net_test_stack_a2dp_native",
1418    defaults: [
1419        "fluoride_defaults",
1420        "mts_defaults",
1421    ],
1422    test_suites: ["general-tests"],
1423    host_supported: true,
1424    test_options: {
1425        unit_test: true,
1426    },
1427    include_dirs: [
1428        "external/libldac/inc",
1429        "packages/modules/Bluetooth/system",
1430        "packages/modules/Bluetooth/system/gd",
1431        "packages/modules/Bluetooth/system/stack/include",
1432    ],
1433    srcs: [
1434        "a2dp/a2dp_vendor_ldac_decoder.cc",
1435        "test/a2dp/a2dp_vendor_ldac_decoder_test.cc",
1436        "test/a2dp/misc_fake.cc",
1437    ],
1438    aidl: {
1439        libs: ["bluetooth_constants"],
1440    },
1441    shared_libs: [
1442        "libbinder",
1443        "libcrypto",
1444        "libcutils",
1445    ],
1446    static_libs: [
1447        "libbase",
1448        "libbluetooth_crypto_toolbox",
1449        "libbluetooth_log",
1450        "libbt-common",
1451        "libchrome",
1452        "libcom.android.sysprop.bluetooth.wrapped",
1453        "liblog",
1454        "libosi",
1455    ],
1456    sanitize: {
1457        address: true,
1458        cfi: true,
1459        misc_undefined: ["bounds"],
1460    },
1461    header_libs: ["libbluetooth_headers"],
1462}
1463
1464// gatt sr hash test
1465cc_test {
1466    name: "net_test_stack_gatt_sr_hash_native",
1467    defaults: [
1468        "fluoride_defaults",
1469        "mts_defaults",
1470    ],
1471    test_suites: ["general-tests"],
1472    host_supported: true,
1473    include_dirs: [
1474        "packages/modules/Bluetooth/system",
1475        "packages/modules/Bluetooth/system/gd",
1476        "packages/modules/Bluetooth/system/stack/btm",
1477        "packages/modules/Bluetooth/system/stack/eatt",
1478        "packages/modules/Bluetooth/system/stack/include",
1479    ],
1480    srcs: [
1481        ":LegacyStackSdp",
1482        ":TestCommonMainHandler",
1483        ":TestCommonMockFunctions",
1484        ":TestMockBta",
1485        ":TestMockBtif",
1486        ":TestMockDevice",
1487        ":TestMockMainShim",
1488        ":TestMockRustFfi",
1489        ":TestMockStackBtm",
1490        ":TestMockStackL2cap",
1491        ":TestMockStackMetrics",
1492        "gatt/gatt_db.cc",
1493        "gatt/gatt_sr_hash.cc",
1494        "gatt/gatt_utils.cc",
1495        "test/common/mock_eatt.cc",
1496        "test/common/mock_gatt_layer.cc",
1497        "test/gatt/mock_gatt_utils_ref.cc",
1498        "test/stack_gatt_sr_hash_test.cc",
1499    ],
1500    aidl: {
1501        libs: ["bluetooth_constants"],
1502    },
1503    shared_libs: [
1504        "libaconfig_storage_read_api_cc",
1505        "libbinder",
1506        "libcrypto",
1507        "libcutils",
1508        "server_configurable_flags",
1509    ],
1510    static_libs: [
1511        "bluetooth_flags_c_lib_for_test",
1512        "libbase",
1513        "libbluetooth-types",
1514        "libbluetooth_core_rs_bridge",
1515        "libbluetooth_crypto_toolbox",
1516        "libbluetooth_gd",
1517        "libbluetooth_hci_pdl",
1518        "libbluetooth_log",
1519        "libbt-common",
1520        "libbt-platform-protos-lite",
1521        "libchrome",
1522        "libcom.android.sysprop.bluetooth.wrapped",
1523        "libevent",
1524        "libgmock",
1525        "liblog",
1526        "libosi",
1527        "libstatslog_bt",
1528    ],
1529    target: {
1530        android: {
1531            shared_libs: ["libstatssocket"],
1532        },
1533    },
1534    header_libs: ["libbluetooth_headers"],
1535}
1536
1537// Iso manager unit tests
1538cc_test {
1539    name: "net_test_btm_iso",
1540    test_suites: ["general-tests"],
1541    host_supported: true,
1542    test_options: {
1543        unit_test: true,
1544    },
1545    defaults: [
1546        "fluoride_defaults",
1547        "mts_defaults",
1548    ],
1549    local_include_dirs: [
1550        "btm",
1551        "include",
1552        "test/common",
1553    ],
1554    include_dirs: [
1555        "packages/modules/Bluetooth/system",
1556        "packages/modules/Bluetooth/system/gd",
1557    ],
1558    srcs: [
1559        ":BluetoothPacketSources",
1560        ":TestCommonMockFunctions",
1561        ":TestCommonStackConfig",
1562        ":TestMockMainShim",
1563        ":TestMockMainShimEntry",
1564        "btm/btm_iso.cc",
1565        "test/btm_iso_test.cc",
1566        "test/common/mock_gatt_layer.cc",
1567        "test/common/mock_hcic_layer.cc",
1568    ],
1569    static_libs: [
1570        "libbase",
1571        "libbluetooth-types",
1572        "libbluetooth_hci_pdl",
1573        "libbluetooth_log",
1574        "libbt-common",
1575        "libbt-platform-protos-lite",
1576        "libchrome",
1577        "libcom.android.sysprop.bluetooth.wrapped",
1578        "libgmock",
1579        "liblog",
1580        "libosi",
1581    ],
1582    sanitize: {
1583        cfi: true,
1584        scs: true,
1585        address: true,
1586        all_undefined: true,
1587        integer_overflow: true,
1588        diag: {
1589            undefined: true,
1590        },
1591    },
1592    header_libs: ["libbluetooth_headers"],
1593}
1594
1595// EATT unit tests
1596cc_test {
1597    name: "net_test_eatt",
1598    test_suites: ["general-tests"],
1599    host_supported: true,
1600    test_options: {
1601        unit_test: true,
1602    },
1603    defaults: [
1604        "fluoride_defaults",
1605        "mts_defaults",
1606    ],
1607    local_include_dirs: [
1608        "btm",
1609        "eatt",
1610        "gatt",
1611        "include",
1612        "l2cap",
1613        "test/common",
1614    ],
1615    include_dirs: [
1616        "packages/modules/Bluetooth/system",
1617        "packages/modules/Bluetooth/system/bta",
1618        "packages/modules/Bluetooth/system/gd",
1619    ],
1620    srcs: [
1621        ":TestCommonMainHandler",
1622        ":TestCommonMockFunctions",
1623        ":TestCommonStackConfig",
1624        ":TestMockMainShim",
1625        ":TestMockMainShimEntry",
1626        ":TestMockStackL2capInterface",
1627        ":TestStubOsi",
1628        "eatt/eatt.cc",
1629        "test/common/mock_btif_storage.cc",
1630        "test/common/mock_btm_api_layer.cc",
1631        "test/common/mock_gatt_layer.cc",
1632        "test/common/mock_l2cap_layer.cc",
1633        "test/eatt/eatt_test.cc",
1634        "test/gatt/mock_gatt_utils_ref.cc",
1635    ],
1636    shared_libs: [
1637        "libcrypto",
1638        "libcutils",
1639    ],
1640    static_libs: [
1641        "bluetooth_flags_c_lib_for_test",
1642        "libbase",
1643        "libbluetooth-types",
1644        "libbluetooth_gd",
1645        "libbluetooth_hci_pdl",
1646        "libbluetooth_log",
1647        "libbt-common",
1648        "libbt-platform-protos-lite",
1649        "libchrome",
1650        "libcom.android.sysprop.bluetooth.wrapped",
1651        "libevent",
1652        "libgmock",
1653        "liblog",
1654        "libosi",
1655        "libprotobuf-cpp-lite",
1656        "libstatslog_bt",
1657        "server_configurable_flags",
1658    ],
1659    target: {
1660        android: {
1661            shared_libs: ["libstatssocket"],
1662        },
1663    },
1664    sanitize: {
1665        cfi: false,
1666    },
1667    header_libs: ["libbluetooth_headers"],
1668}
1669
1670cc_test {
1671    name: "net_test_stack_btm",
1672    test_suites: ["general-tests"],
1673    host_supported: true,
1674    test_options: {
1675        unit_test: true,
1676    },
1677    defaults: [
1678        "fluoride_defaults",
1679        "mts_defaults",
1680    ],
1681    local_include_dirs: [
1682        "btm",
1683        "include",
1684        "test/common",
1685    ],
1686    include_dirs: [
1687        "packages/modules/Bluetooth/system",
1688        "packages/modules/Bluetooth/system/gd",
1689    ],
1690    srcs: [
1691        ":BluetoothHalSources_hci_host",
1692        ":BluetoothHalSources_ranging_host",
1693        ":BluetoothHciFake",
1694        ":BluetoothOsSources_host",
1695        ":OsiCompatSources",
1696        ":TestCommonMainHandler",
1697        ":TestCommonMockFunctions",
1698        ":TestCommonStackConfig",
1699        ":TestFakeLooper",
1700        ":TestFakeOsi",
1701        ":TestFakeThread",
1702        ":TestMockBta",
1703        ":TestMockBtif",
1704        ":TestMockDevice",
1705        ":TestMockLegacyHciInterface",
1706        ":TestMockMainBte",
1707        ":TestMockMainShim",
1708        ":TestMockMainShimEntry",
1709        ":TestMockRustFfi",
1710        ":TestMockStackBtu",
1711        ":TestMockStackConnMgr",
1712        ":TestMockStackGap",
1713        ":TestMockStackGatt",
1714        ":TestMockStackHcic",
1715        ":TestMockStackL2cap",
1716        ":TestMockStackRnr",
1717        ":TestMockStackSmp",
1718        ":TestMockUdrv",
1719        "acl/acl.cc",
1720        "acl/ble_acl.cc",
1721        "acl/btm_acl.cc",
1722        "acl/btm_pm.cc",
1723        "btm/ble_scanner_hci_interface.cc",
1724        "btm/btm_ble.cc",
1725        "btm/btm_ble_addr.cc",
1726        "btm/btm_ble_adv_filter.cc",
1727        "btm/btm_ble_cont_energy.cc",
1728        "btm/btm_ble_gap.cc",
1729        "btm/btm_ble_privacy.cc",
1730        "btm/btm_ble_scanner.cc",
1731        "btm/btm_ble_sec.cc",
1732        "btm/btm_client_interface.cc",
1733        "btm/btm_dev.cc",
1734        "btm/btm_devctl.cc",
1735        "btm/btm_inq.cc",
1736        "btm/btm_iot_config.cc",
1737        "btm/btm_iso.cc",
1738        "btm/btm_main.cc",
1739        "btm/btm_sco.cc",
1740        "btm/btm_sco_hci.cc",
1741        "btm/btm_sco_hfp_hal.cc",
1742        "btm/btm_sec.cc",
1743        "btm/btm_sec_cb.cc",
1744        "btm/btm_security_client_interface.cc",
1745        "btm/hfp_lc3_decoder.cc",
1746        "btm/hfp_lc3_encoder.cc",
1747        "btm/hfp_msbc_decoder.cc",
1748        "btm/hfp_msbc_encoder.cc",
1749        "btm/security_event_parser.cc",
1750        "metrics/stack_metrics_logging.cc",
1751        "test/btm/peer_packet_types_test.cc",
1752        "test/btm/sco_hci_test.cc",
1753        "test/btm/sco_pkt_status_test.cc",
1754        "test/btm/stack_btm_dev_test.cc",
1755        "test/btm/stack_btm_inq_test.cc",
1756        "test/btm/stack_btm_power_mode_test.cc",
1757        "test/btm/stack_btm_regression_tests.cc",
1758        "test/btm/stack_btm_sec_test.cc",
1759        "test/btm/stack_btm_test.cc",
1760        "test/common/mock_eatt.cc",
1761        "test/stack_include_test.cc",
1762    ],
1763    static_libs: [
1764        "bluetooth_flags_c_lib_for_test",
1765        "libbase",
1766        "libbluetooth-types",
1767        "libbluetooth_core_rs_bridge",
1768        "libbluetooth_crypto_toolbox",
1769        "libbluetooth_gd",
1770        "libbluetooth_log",
1771        "libbt-common",
1772        "libbt-platform-protos-lite",
1773        "libbt-sbc-decoder",
1774        "libbt-sbc-encoder",
1775        "libbtdevice",
1776        "libchrome",
1777        "libcom.android.sysprop.bluetooth.wrapped",
1778        "libevent",
1779        "libgmock",
1780        "liblc3",
1781        "liblog",
1782        "libosi",
1783        "libprotobuf-cpp-lite",
1784        "libudrv-uipc",
1785    ],
1786    aidl: {
1787        libs: ["bluetooth_constants"],
1788    },
1789    shared_libs: [
1790        "libaconfig_storage_read_api_cc",
1791        "libbinder",
1792        "libcrypto",
1793        "libcutils",
1794        "server_configurable_flags",
1795    ],
1796    sanitize: {
1797        address: true,
1798        all_undefined: true,
1799        cfi: true,
1800        integer_overflow: true,
1801        scs: true,
1802        diag: {
1803            undefined: true,
1804        },
1805    },
1806    header_libs: ["libbluetooth_headers"],
1807}
1808
1809cc_test {
1810    name: "net_test_stack_hci",
1811    test_suites: ["general-tests"],
1812    host_supported: true,
1813    defaults: [
1814        "fluoride_defaults",
1815        "mts_defaults",
1816    ],
1817    local_include_dirs: [
1818        "btm",
1819        "include",
1820        "test/common",
1821    ],
1822    include_dirs: [
1823        "packages/modules/Bluetooth/system",
1824        "packages/modules/Bluetooth/system/gd",
1825    ],
1826    srcs: [
1827        ":TestCommonMockFunctions",
1828        "test/hci/stack_hci_test.cc",
1829    ],
1830    static_libs: [
1831        "libbase",
1832        "libbluetooth_crypto_toolbox",
1833        "libbluetooth_log",
1834        "libbt-common",
1835        "libbtdevice",
1836        "libbte",
1837        "libchrome",
1838        "libcom.android.sysprop.bluetooth.wrapped",
1839        "libgmock",
1840        "liblog",
1841        "libosi",
1842    ],
1843    shared_libs: [
1844        "libcrypto",
1845    ],
1846    sanitize: {
1847        address: true,
1848        all_undefined: true,
1849        cfi: true,
1850        integer_overflow: true,
1851        scs: true,
1852        diag: {
1853            undefined: true,
1854        },
1855    },
1856    header_libs: ["libbluetooth_headers"],
1857}
1858
1859cc_test {
1860    name: "net_test_stack_hid",
1861    test_suites: ["general-tests"],
1862    host_supported: true,
1863    defaults: [
1864        "fluoride_defaults",
1865        "mts_defaults",
1866    ],
1867    local_include_dirs: [
1868        "include",
1869        "test/common",
1870    ],
1871    include_dirs: [
1872        "packages/modules/Bluetooth/system",
1873        "packages/modules/Bluetooth/system/gd",
1874        "packages/modules/Bluetooth/system/stack/btm",
1875    ],
1876    srcs: [
1877        ":TestCommonMockFunctions",
1878        ":TestMockStackBtm",
1879        ":TestMockStackL2cap",
1880        ":TestMockStackMetrics",
1881        ":TestMockStackSdp",
1882        "hid/hidd_api.cc",
1883        "hid/hidd_conn.cc",
1884        "hid/hidh_api.cc",
1885        "hid/hidh_conn.cc",
1886        "test/hid/stack_hid_test.cc",
1887    ],
1888    static_libs: [
1889        "libbase",
1890        "libbluetooth-types",
1891        "libbluetooth_crypto_toolbox",
1892        "libbluetooth_hci_pdl",
1893        "libbluetooth_log",
1894        "libbt-common",
1895        "libbt-platform-protos-lite",
1896        "libbtdevice",
1897        "libbte",
1898        "libchrome",
1899        "libcom.android.sysprop.bluetooth.wrapped",
1900        "libevent",
1901        "libgmock",
1902        "liblog",
1903        "libosi",
1904        "libprotobuf-cpp-lite",
1905    ],
1906    shared_libs: [
1907        "libcrypto",
1908    ],
1909    target: {
1910        android: {
1911            shared_libs: ["libstatssocket"],
1912        },
1913    },
1914    sanitize: {
1915        address: true,
1916        all_undefined: true,
1917        cfi: true,
1918        integer_overflow: true,
1919        scs: true,
1920        diag: {
1921            undefined: true,
1922        },
1923    },
1924    header_libs: ["libbluetooth_headers"],
1925}
1926
1927cc_test {
1928    name: "net_test_stack_btu",
1929    test_suites: ["general-tests"],
1930    host_supported: true,
1931    defaults: [
1932        "fluoride_defaults",
1933        "mts_defaults",
1934    ],
1935    local_include_dirs: [
1936        "include",
1937        "test/common",
1938    ],
1939    include_dirs: [
1940        "packages/modules/Bluetooth/system",
1941        "packages/modules/Bluetooth/system/gd",
1942        "packages/modules/Bluetooth/system/stack/btm",
1943    ],
1944    srcs: [
1945        ":TestCommonMockFunctions",
1946        ":TestMockBta",
1947        ":TestMockBtif",
1948        ":TestMockHci",
1949        ":TestMockLegacyHciCommands",
1950        ":TestMockMainShim",
1951        ":TestMockMainShimEntry",
1952        ":TestMockStackAcl",
1953        ":TestMockStackBtm",
1954        ":TestMockStackHcic",
1955        ":TestMockStackL2cap",
1956        ":TestMockStackMetrics",
1957        ":TestMockStackSmp",
1958        "btu/btu_hcif.cc",
1959        "btu/main_thread.cc",
1960        "test/stack_btu_test.cc",
1961    ],
1962    static_libs: [
1963        "bluetooth_flags_c_lib_for_test",
1964        "libbase",
1965        "libbluetooth-types",
1966        "libbluetooth_gd",
1967        "libbluetooth_hci_pdl",
1968        "libbluetooth_log",
1969        "libbt-common",
1970        "libbt-platform-protos-lite",
1971        "libbtdevice",
1972        "libchrome",
1973        "libcom.android.sysprop.bluetooth.wrapped",
1974        "libevent",
1975        "libgmock",
1976        "liblog",
1977        "libosi",
1978        "server_configurable_flags",
1979    ],
1980    aidl: {
1981        libs: ["bluetooth_constants"],
1982    },
1983    shared_libs: [
1984        "libbinder",
1985        "libbinder_ndk",
1986        "libcrypto",
1987    ],
1988    sanitize: {
1989        address: true,
1990        all_undefined: true,
1991        cfi: true,
1992        integer_overflow: true,
1993        scs: true,
1994        diag: {
1995            undefined: true,
1996        },
1997    },
1998    header_libs: ["libbluetooth_headers"],
1999}
2000
2001cc_test {
2002    name: "net_test_stack_gatt",
2003    test_suites: ["general-tests"],
2004    host_supported: true,
2005    defaults: [
2006        "fluoride_defaults",
2007        "mts_defaults",
2008    ],
2009    local_include_dirs: [
2010        "include",
2011        "test/common",
2012    ],
2013    include_dirs: [
2014        "packages/modules/Bluetooth/system",
2015        "packages/modules/Bluetooth/system/gd",
2016        "packages/modules/Bluetooth/system/stack/btm",
2017    ],
2018    srcs: [
2019        ":OsiCompatSources",
2020        ":TestCommonMainHandler",
2021        ":TestCommonMockFunctions",
2022        ":TestCommonStackConfig",
2023        ":TestMockBta",
2024        ":TestMockBtif",
2025        ":TestMockHci",
2026        ":TestMockLegacyHciCommands",
2027        ":TestMockMainShim",
2028        ":TestMockMainShimEntry",
2029        ":TestMockRustFfi",
2030        ":TestMockSrvcDis",
2031        ":TestMockStackAcl",
2032        ":TestMockStackBtm",
2033        ":TestMockStackL2cap",
2034        ":TestMockStackMetrics",
2035        ":TestMockStackSdp",
2036        ":TestMockStackSmp",
2037        "ais/ais_ble.cc",
2038        "arbiter/acl_arbiter.cc",
2039        "connection_manager/connection_manager.cc",
2040        "eatt/eatt.cc",
2041        "gatt/att_protocol.cc",
2042        "gatt/gatt_api.cc",
2043        "gatt/gatt_attr.cc",
2044        "gatt/gatt_auth.cc",
2045        "gatt/gatt_cl.cc",
2046        "gatt/gatt_db.cc",
2047        "gatt/gatt_main.cc",
2048        "gatt/gatt_sr.cc",
2049        "gatt/gatt_sr_hash.cc",
2050        "gatt/gatt_utils.cc",
2051        "test/gatt/stack_gatt_test.cc",
2052    ],
2053    static_libs: [
2054        "bluetooth_flags_c_lib_for_test",
2055        "libbase",
2056        "libbluetooth-types",
2057        "libbluetooth_core_rs_bridge",
2058        "libbluetooth_crypto_toolbox",
2059        "libbluetooth_gd",
2060        "libbluetooth_log",
2061        "libbt-common",
2062        "libbt-platform-protos-lite",
2063        "libbtdevice",
2064        "libchrome",
2065        "libcom.android.sysprop.bluetooth.wrapped",
2066        "libevent",
2067        "libflagtest",
2068        "libgmock",
2069        "liblog",
2070        "libosi",
2071        "libprotobuf-cpp-lite",
2072        "libstatslog_bt",
2073    ],
2074    aidl: {
2075        libs: ["bluetooth_constants"],
2076    },
2077    shared_libs: [
2078        "libaconfig_storage_read_api_cc",
2079        "libbase",
2080        "libbinder",
2081        "libbinder_ndk",
2082        "libcrypto",
2083        "libcutils",
2084        "server_configurable_flags",
2085    ],
2086    target: {
2087        android: {
2088            shared_libs: ["libstatssocket"],
2089        },
2090    },
2091    sanitize: {
2092        address: true,
2093        all_undefined: true,
2094        cfi: true,
2095        integer_overflow: true,
2096        scs: true,
2097        diag: {
2098            undefined: true,
2099        },
2100    },
2101    header_libs: ["libbluetooth_headers"],
2102}
2103
2104cc_test {
2105    name: "net_test_stack_l2cap",
2106    test_suites: ["general-tests"],
2107    host_supported: true,
2108    defaults: [
2109        "fluoride_defaults",
2110        "mts_defaults",
2111    ],
2112    local_include_dirs: [
2113        "include",
2114        "test/common",
2115    ],
2116    include_dirs: [
2117        "packages/modules/Bluetooth/system",
2118        "packages/modules/Bluetooth/system/gd",
2119        "packages/modules/Bluetooth/system/stack/btm",
2120    ],
2121    srcs: [
2122        ":OsiCompatSources",
2123        ":TestCommonMainHandler",
2124        ":TestCommonMockFunctions",
2125        ":TestCommonStackConfig",
2126        ":TestMockBta",
2127        ":TestMockBtif",
2128        ":TestMockHci",
2129        ":TestMockJni",
2130        ":TestMockLegacyHciCommands",
2131        ":TestMockMainShim",
2132        ":TestMockMainShimEntry",
2133        ":TestMockStackAcl",
2134        ":TestMockStackBtm",
2135        ":TestMockStackConnMgr",
2136        ":TestMockStackHcic",
2137        ":TestMockStackSdp",
2138        ":TestMockStackSmp",
2139        "l2cap/l2c_api.cc",
2140        "l2cap/l2c_ble.cc",
2141        "l2cap/l2c_ble_conn_params.cc",
2142        "l2cap/l2c_csm.cc",
2143        "l2cap/l2c_fcr.cc",
2144        "l2cap/l2c_link.cc",
2145        "l2cap/l2c_main.cc",
2146        "l2cap/l2c_utils.cc",
2147        "l2cap/l2cap_api.cc",
2148        "test/stack_l2cap_test.cc",
2149    ],
2150    static_libs: [
2151        "bluetooth_flags_c_lib",
2152        "libbluetooth-types",
2153        "libbluetooth_gd",
2154        "libbluetooth_log",
2155        "libbt-common",
2156        "libbt-platform-protos-lite",
2157        "libbtdevice",
2158        "libchrome",
2159        "libcom.android.sysprop.bluetooth.wrapped",
2160        "libevent",
2161        "libgmock",
2162        "liblog",
2163        "libosi",
2164        "libprotobuf-cpp-lite",
2165        "libstatslog_bt",
2166    ],
2167    aidl: {
2168        libs: ["bluetooth_constants"],
2169    },
2170    shared_libs: [
2171        "libaconfig_storage_read_api_cc",
2172        "libbase",
2173        "libbinder",
2174        "libbinder_ndk",
2175        "libcrypto",
2176        "libcutils",
2177        "server_configurable_flags",
2178    ],
2179    target: {
2180        android: {
2181            shared_libs: [
2182                "libPlatformProperties",
2183                "libstatssocket",
2184            ],
2185        },
2186    },
2187    sanitize: {
2188        address: true,
2189        all_undefined: true,
2190        cfi: true,
2191        integer_overflow: true,
2192        scs: true,
2193        diag: {
2194            undefined: true,
2195        },
2196    },
2197    header_libs: ["libbluetooth_headers"],
2198}
2199
2200cc_test {
2201    name: "net_test_stack_acl",
2202    test_suites: ["general-tests"],
2203    host_supported: true,
2204    defaults: [
2205        "fluoride_defaults",
2206        "mts_defaults",
2207    ],
2208    local_include_dirs: [
2209        "include",
2210        "test/common",
2211    ],
2212    include_dirs: [
2213        "packages/modules/Bluetooth/system",
2214        "packages/modules/Bluetooth/system/gd",
2215        "packages/modules/Bluetooth/system/stack/btm",
2216    ],
2217    srcs: [
2218        ":OsiCompatSources",
2219        ":TestCommonMainHandler",
2220        ":TestCommonMockFunctions",
2221        ":TestCommonStackConfig",
2222        ":TestMockBta",
2223        ":TestMockBtif",
2224        ":TestMockDevice",
2225        ":TestMockHci",
2226        ":TestMockLegacyHciCommands",
2227        ":TestMockLegacyHciInterface",
2228        ":TestMockMainShim",
2229        ":TestMockMainShimEntry",
2230        ":TestMockRustFfi",
2231        ":TestMockStackBtm",
2232        ":TestMockStackBtu",
2233        ":TestMockStackConnMgr",
2234        ":TestMockStackGatt",
2235        ":TestMockStackHcic",
2236        ":TestMockStackL2cap",
2237        ":TestMockStackMetrics",
2238        ":TestMockStackSdp",
2239        ":TestMockStackSmp",
2240        "acl/*.cc",
2241        "btm/btm_iot_config.cc",
2242        "test/stack_acl_test.cc",
2243    ],
2244    static_libs: [
2245        "bluetooth_flags_c_lib",
2246        "libbluetooth-types",
2247        "libbluetooth_core_rs_bridge",
2248        "libbluetooth_gd",
2249        "libbluetooth_hci_pdl",
2250        "libbluetooth_log",
2251        "libbt-common",
2252        "libbt-platform-protos-lite",
2253        "libbtdevice",
2254        "libchrome",
2255        "libcom.android.sysprop.bluetooth.wrapped",
2256        "libcutils",
2257        "libevent",
2258        "libgmock",
2259        "liblog",
2260        "libosi",
2261        "libstatslog_bt",
2262    ],
2263    aidl: {
2264        libs: ["bluetooth_constants"],
2265    },
2266    shared_libs: [
2267        "libaconfig_storage_read_api_cc",
2268        "libbase",
2269        "libbinder",
2270        "libbinder_ndk",
2271        "libcrypto",
2272        "server_configurable_flags",
2273    ],
2274    target: {
2275        android: {
2276            shared_libs: ["libstatssocket"],
2277        },
2278    },
2279    sanitize: {
2280        address: true,
2281        all_undefined: true,
2282        cfi: true,
2283        integer_overflow: true,
2284        scs: true,
2285        diag: {
2286            undefined: true,
2287        },
2288    },
2289    header_libs: ["libbluetooth_headers"],
2290}
2291
2292cc_test {
2293    name: "net_test_stack_rnr",
2294    test_suites: ["general-tests"],
2295    host_supported: true,
2296    test_options: {
2297        unit_test: true,
2298    },
2299    defaults: [
2300        "fluoride_defaults",
2301        "mts_defaults",
2302    ],
2303    local_include_dirs: [
2304        "btm",
2305        "include",
2306        "test/common",
2307    ],
2308    include_dirs: [
2309        "packages/modules/Bluetooth/system",
2310        "packages/modules/Bluetooth/system/gd",
2311    ],
2312    srcs: [
2313        ":BluetoothHalSources_hci_host",
2314        ":BluetoothHalSources_ranging_host",
2315        ":BluetoothHciFake",
2316        ":BluetoothOsSources_host",
2317        ":OsiCompatSources",
2318        ":TestCommonMainHandler",
2319        ":TestCommonMockFunctions",
2320        ":TestCommonStackConfig",
2321        ":TestFakeLooper",
2322        ":TestFakeOsi",
2323        ":TestFakeThread",
2324        ":TestMockBta",
2325        ":TestMockBtif",
2326        ":TestMockDevice",
2327        ":TestMockLegacyHciInterface",
2328        ":TestMockMainBte",
2329        ":TestMockMainShim",
2330        ":TestMockMainShimEntry",
2331        ":TestMockRustFfi",
2332        ":TestMockStackBtm",
2333        ":TestMockStackBtu",
2334        ":TestMockStackGap",
2335        ":TestMockStackGatt",
2336        ":TestMockStackHcic",
2337        ":TestMockStackL2cap",
2338        ":TestMockStackSmp",
2339        ":TestMockUdrv",
2340        "rnr/remote_name_request.cc",
2341        "test/stack_rnr_test.cc",
2342    ],
2343    static_libs: [
2344        "bluetooth_flags_c_lib_for_test",
2345        "libbase",
2346        "libbluetooth-types",
2347        "libbluetooth_core_rs_bridge",
2348        "libbluetooth_crypto_toolbox",
2349        "libbluetooth_gd",
2350        "libbluetooth_log",
2351        "libbt-common",
2352        "libbt-platform-protos-lite",
2353        "libbt-sbc-decoder",
2354        "libbt-sbc-encoder",
2355        "libbtdevice",
2356        "libchrome",
2357        "libcom.android.sysprop.bluetooth.wrapped",
2358        "libevent",
2359        "libgmock",
2360        "liblc3",
2361        "liblog",
2362        "libosi",
2363        "libprotobuf-cpp-lite",
2364        "libudrv-uipc",
2365    ],
2366    aidl: {
2367        libs: ["bluetooth_constants"],
2368    },
2369    shared_libs: [
2370        "libaconfig_storage_read_api_cc",
2371        "libbinder",
2372        "libcrypto",
2373        "libcutils",
2374        "server_configurable_flags",
2375    ],
2376    sanitize: {
2377        address: true,
2378        all_undefined: true,
2379        cfi: true,
2380        integer_overflow: true,
2381        scs: true,
2382        diag: {
2383            undefined: true,
2384        },
2385    },
2386    header_libs: ["libbluetooth_headers"],
2387}
2388
2389// Bluetooth stack connection multiplexing
2390cc_test {
2391    name: "net_test_stack_sdp",
2392    test_suites: ["general-tests"],
2393    host_supported: true,
2394    defaults: [
2395        "fluoride_defaults",
2396        "mts_defaults",
2397    ],
2398    local_include_dirs: [
2399        "include",
2400        "test/common",
2401    ],
2402    include_dirs: [
2403        "packages/modules/Bluetooth/system",
2404        "packages/modules/Bluetooth/system/gd",
2405        "packages/modules/Bluetooth/system/stack/btm",
2406    ],
2407    srcs: [
2408        ":LegacyStackSdp",
2409        ":TestCommonMockFunctions",
2410        ":TestFakeOsi",
2411        ":TestMockBta",
2412        ":TestMockBtif",
2413        ":TestMockStackBtm",
2414        ":TestMockStackL2cap",
2415        ":TestMockStackMetrics",
2416        "test/sdp/stack_sdp_api_test.cc",
2417        "test/sdp/stack_sdp_db_test.cc",
2418        "test/sdp/stack_sdp_parse_test.cc",
2419        "test/sdp/stack_sdp_test.cc",
2420        "test/sdp/stack_sdp_utils_test.cc",
2421    ],
2422    static_libs: [
2423        "bluetooth_flags_c_lib_for_test",
2424        "libbase",
2425        "libbluetooth-types",
2426        "libbluetooth_gd",
2427        "libbluetooth_hci_pdl",
2428        "libbluetooth_log",
2429        "libbt-common",
2430        "libbt-platform-protos-lite",
2431        "libchrome",
2432        "libflagtest",
2433        "libgmock",
2434        "liblog",
2435    ],
2436    aidl: {
2437        libs: ["bluetooth_constants"],
2438    },
2439    shared_libs: [
2440        "libaconfig_storage_read_api_cc",
2441        "libbinder",
2442        "libcrypto",
2443        "libcutils",
2444        "server_configurable_flags",
2445    ],
2446    header_libs: ["libbluetooth_headers"],
2447}
2448