1crypto_toolbox_srcs = [ 2 "crypto_toolbox/aes.cc", 3 "crypto_toolbox/aes_cmac.cc", 4 "crypto_toolbox/crypto_toolbox.cc", 5] 6 7// Bluetooth stack static library for target 8// ======================================================== 9cc_library_static { 10 name: "libbt-stack", 11 defaults: ["fluoride_defaults"], 12 local_include_dirs: [ 13 "include", 14 "avct", 15 "btm", 16 "avrc", 17 "l2cap", 18 "avdt", 19 "gatt", 20 "gap", 21 "pan", 22 "bnep", 23 "hid", 24 "sdp", 25 "smp", 26 "srvc", 27 ], 28 header_libs: [ 29 "libbluetooth_headers", 30 ], 31 include_dirs: [ 32 "external/aac/libAACenc/include", 33 "external/aac/libAACdec/include", 34 "external/aac/libSYS/include", 35 "external/libldac/inc", 36 "external/libldac/abr/inc", 37 "system/bt", 38 "system/bt/btcore/include", 39 "system/bt/vnd/include", 40 "system/bt/vnd/ble", 41 "system/bt/btif/include", 42 "system/bt/hci/include", 43 "system/bt/internal_include", 44 "system/bt/udrv/include", 45 "system/bt/bta/include", 46 "system/bt/bta/sys", 47 "system/bt/utils/include", 48 ], 49 srcs: crypto_toolbox_srcs + [ 50 "a2dp/a2dp_aac.cc", 51 "a2dp/a2dp_aac_decoder.cc", 52 "a2dp/a2dp_aac_encoder.cc", 53 "a2dp/a2dp_api.cc", 54 "a2dp/a2dp_codec_config.cc", 55 "a2dp/a2dp_sbc.cc", 56 "a2dp/a2dp_sbc_decoder.cc", 57 "a2dp/a2dp_sbc_encoder.cc", 58 "a2dp/a2dp_sbc_up_sample.cc", 59 "a2dp/a2dp_vendor.cc", 60 "a2dp/a2dp_vendor_aptx.cc", 61 "a2dp/a2dp_vendor_aptx_hd.cc", 62 "a2dp/a2dp_vendor_aptx_encoder.cc", 63 "a2dp/a2dp_vendor_aptx_hd_encoder.cc", 64 "a2dp/a2dp_vendor_ldac.cc", 65 "a2dp/a2dp_vendor_ldac_abr.cc", 66 "a2dp/a2dp_vendor_ldac_decoder.cc", 67 "a2dp/a2dp_vendor_ldac_encoder.cc", 68 "avct/avct_api.cc", 69 "avct/avct_bcb_act.cc", 70 "avct/avct_ccb.cc", 71 "avct/avct_l2c.cc", 72 "avct/avct_l2c_br.cc", 73 "avct/avct_lcb.cc", 74 "avct/avct_lcb_act.cc", 75 "avdt/avdt_ad.cc", 76 "avdt/avdt_api.cc", 77 "avdt/avdt_ccb.cc", 78 "avdt/avdt_ccb_act.cc", 79 "avdt/avdt_l2c.cc", 80 "avdt/avdt_msg.cc", 81 "avdt/avdt_scb.cc", 82 "avdt/avdt_scb_act.cc", 83 "avrc/avrc_api.cc", 84 "avrc/avrc_bld_ct.cc", 85 "avrc/avrc_bld_tg.cc", 86 "avrc/avrc_opt.cc", 87 "avrc/avrc_pars_ct.cc", 88 "avrc/avrc_pars_tg.cc", 89 "avrc/avrc_sdp.cc", 90 "avrc/avrc_utils.cc", 91 "bnep/bnep_api.cc", 92 "bnep/bnep_main.cc", 93 "bnep/bnep_utils.cc", 94 "btm/ble_advertiser_hci_interface.cc", 95 "btm/btm_acl.cc", 96 "btm/btm_ble.cc", 97 "btm/btm_ble_addr.cc", 98 "btm/btm_ble_adv_filter.cc", 99 "btm/btm_ble_batchscan.cc", 100 "btm/btm_ble_bgconn.cc", 101 "btm/btm_ble_connection_establishment.cc", 102 "btm/btm_ble_cont_energy.cc", 103 "btm/btm_ble_gap.cc", 104 "btm/btm_ble_multi_adv.cc", 105 "btm/btm_ble_privacy.cc", 106 "btm/btm_dev.cc", 107 "btm/btm_devctl.cc", 108 "btm/btm_inq.cc", 109 "btm/btm_main.cc", 110 "btm/btm_pm.cc", 111 "btm/btm_sco.cc", 112 "btm/btm_sec.cc", 113 "btu/btu_hcif.cc", 114 "btu/btu_init.cc", 115 "btu/btu_task.cc", 116 "gap/gap_ble.cc", 117 "gap/gap_conn.cc", 118 "gatt/att_protocol.cc", 119 "gatt/connection_manager.cc", 120 "gatt/gatt_api.cc", 121 "gatt/gatt_attr.cc", 122 "gatt/gatt_auth.cc", 123 "gatt/gatt_cl.cc", 124 "gatt/gatt_db.cc", 125 "gatt/gatt_main.cc", 126 "gatt/gatt_sr.cc", 127 "gatt/gatt_utils.cc", 128 "hcic/hciblecmds.cc", 129 "hcic/hcicmds.cc", 130 "hid/hidh_api.cc", 131 "hid/hidh_conn.cc", 132 "hid/hidd_api.cc", 133 "hid/hidd_conn.cc", 134 "l2cap/l2c_api.cc", 135 "l2cap/l2c_ble.cc", 136 "l2cap/l2c_csm.cc", 137 "l2cap/l2c_fcr.cc", 138 "l2cap/l2c_link.cc", 139 "l2cap/l2c_main.cc", 140 "l2cap/l2c_utils.cc", 141 "pan/pan_api.cc", 142 "pan/pan_main.cc", 143 "pan/pan_utils.cc", 144 "rfcomm/port_api.cc", 145 "rfcomm/port_rfc.cc", 146 "rfcomm/port_utils.cc", 147 "rfcomm/rfc_l2cap_if.cc", 148 "rfcomm/rfc_mx_fsm.cc", 149 "rfcomm/rfc_port_fsm.cc", 150 "rfcomm/rfc_port_if.cc", 151 "rfcomm/rfc_ts_frames.cc", 152 "rfcomm/rfc_utils.cc", 153 "sdp/sdp_api.cc", 154 "sdp/sdp_db.cc", 155 "sdp/sdp_discovery.cc", 156 "sdp/sdp_main.cc", 157 "sdp/sdp_server.cc", 158 "sdp/sdp_utils.cc", 159 "smp/p_256_curvepara.cc", 160 "smp/p_256_ecc_pp.cc", 161 "smp/p_256_multprecision.cc", 162 "smp/smp_act.cc", 163 "smp/smp_api.cc", 164 "smp/smp_br_main.cc", 165 "smp/smp_keys.cc", 166 "smp/smp_l2c.cc", 167 "smp/smp_main.cc", 168 "smp/smp_utils.cc", 169 "srvc/srvc_dis.cc", 170 "srvc/srvc_eng.cc", 171 ], 172 static_libs: [ 173 "libbt-hci", 174 "libFraunhoferAAC", 175 ], 176 shared_libs: [ 177 "libcutils", 178 "liblog", 179 ], 180 required: [ 181 "libldacBT_enc", 182 "libldacBT_abr", 183 ], 184} 185 186// Bluetooth stack unit tests for target 187// ======================================================== 188cc_test { 189 name: "net_test_stack", 190 defaults: ["fluoride_defaults"], 191 test_suites: ["device-tests"], 192 local_include_dirs: [ 193 "include", 194 ], 195 include_dirs: [ 196 "system/bt", 197 "system/bt/internal_include", 198 ], 199 srcs: [ 200 "test/stack_a2dp_test.cc", 201 "test/stack_avrcp_test.cc", 202 ], 203 shared_libs: [ 204 "android.hardware.bluetooth@1.0", 205 "android.hardware.bluetooth@1.1", 206 "android.hardware.bluetooth.a2dp@1.0", 207 "android.hardware.bluetooth.audio@2.0", 208 "libaaudio", 209 "libcutils", 210 "libdl", 211 "libfmq", 212 "libhidlbase", 213 "liblog", 214 "libprocessgroup", 215 "libprotobuf-cpp-lite", 216 "libutils", 217 "libtinyxml2", 218 "libz", 219 "libcrypto", 220 "android.hardware.keymaster@4.0", 221 "android.hardware.keymaster@3.0", 222 "libkeymaster4support", 223 "libkeystore_aidl", 224 "libkeystore_binder", 225 "libkeystore_parcelables", 226 ], 227 static_libs: [ 228 "libbt-audio-hal-interface", 229 "libbtcore", 230 "libbt-bta", 231 "libbt-stack", 232 "libbt-common", 233 "libbt-sbc-decoder", 234 "libbt-sbc-encoder", 235 "libbt-utils", 236 "libbtif", 237 "libFraunhoferAAC", 238 "libbt-hci", 239 "libbtdevice", 240 "libg722codec", 241 "libosi", 242 "libudrv-uipc", 243 "libbt-protos-lite", 244 ], 245 whole_static_libs: [ 246 "libbluetooth-for-tests", 247 ], 248} 249 250cc_test { 251 name: "net_test_stack_rfcomm", 252 defaults: ["fluoride_defaults"], 253 test_suites: ["device-tests"], 254 host_supported: true, 255 local_include_dirs: [ 256 "include", 257 "btm", 258 "l2cap", 259 "smp", 260 "rfcomm", 261 "test/common", 262 ], 263 include_dirs: [ 264 "system/bt", 265 "system/bt/internal_include", 266 "system/bt/btcore/include", 267 "system/bt/hci/include", 268 "system/bt/utils/include", 269 ], 270 srcs: [ 271 "rfcomm/port_api.cc", 272 "rfcomm/port_rfc.cc", 273 "rfcomm/port_utils.cc", 274 "rfcomm/rfc_l2cap_if.cc", 275 "rfcomm/rfc_mx_fsm.cc", 276 "rfcomm/rfc_port_fsm.cc", 277 "rfcomm/rfc_port_if.cc", 278 "rfcomm/rfc_ts_frames.cc", 279 "rfcomm/rfc_utils.cc", 280 "test/common/mock_btm_layer.cc", 281 "test/common/mock_btsnoop_module.cc", 282 "test/common/mock_btu_layer.cc", 283 "test/common/mock_l2cap_layer.cc", 284 "test/common/stack_test_packet_utils.cc", 285 "test/rfcomm/stack_rfcomm_test.cc", 286 "test/rfcomm/stack_rfcomm_test_main.cc", 287 "test/rfcomm/stack_rfcomm_test_utils.cc", 288 "test/rfcomm/stack_rfcomm_test_utils_test.cc", 289 ], 290 shared_libs: [ 291 "libcutils", 292 "libprotobuf-cpp-lite", 293 "libcrypto", 294 ], 295 static_libs: [ 296 "liblog", 297 "libgmock", 298 "libosi", 299 "libbt-common", 300 "libbt-protos-lite", 301 ], 302 sanitize: { 303 cfi: false, 304 }, 305} 306 307// Bluetooth stack smp unit tests for target 308// ======================================================== 309cc_test { 310 name: "net_test_stack_smp", 311 defaults: ["fluoride_defaults"], 312 test_suites: ["device-tests"], 313 local_include_dirs: [ 314 "include", 315 "btm", 316 "l2cap", 317 "smp", 318 ], 319 include_dirs: [ 320 "system/bt", 321 "system/bt/internal_include", 322 "system/bt/btcore/include", 323 "system/bt/hci/include", 324 "system/bt/utils/include", 325 ], 326 srcs: crypto_toolbox_srcs + [ 327 "smp/smp_keys.cc", 328 "smp/p_256_curvepara.cc", 329 "smp/p_256_ecc_pp.cc", 330 "smp/p_256_multprecision.cc", 331 "smp/smp_api.cc", 332 "smp/smp_main.cc", 333 "smp/smp_utils.cc", 334 "test/crypto_toolbox_test.cc", 335 "test/stack_smp_test.cc", 336 ], 337 shared_libs: [ 338 "libcutils", 339 ], 340 static_libs: [ 341 "liblog", 342 "libgmock", 343 "libosi", 344 ], 345} 346 347// Bluetooth stack multi-advertising unit tests for target 348// ======================================================== 349cc_test { 350 name: "net_test_stack_multi_adv", 351 defaults: ["fluoride_defaults"], 352 test_suites: ["device-tests"], 353 local_include_dirs: [ 354 "include", 355 "btm", 356 ], 357 include_dirs: [ 358 "system/bt", 359 "system/bt/internal_include", 360 "system/bt/btcore/include", 361 "system/bt/hci/include", 362 "system/bt/internal_include", 363 "system/bt/utils/include", 364 ], 365 srcs: [ 366 "btm/btm_ble_multi_adv.cc", 367 "test/ble_advertiser_test.cc", 368 ], 369 shared_libs: [ 370 "libcutils", 371 ], 372 static_libs: [ 373 "libbluetooth-types", 374 "liblog", 375 "libgmock", 376 ], 377 sanitize: { 378 cfi: false, 379 }, 380} 381 382// Bluetooth stack advertise data parsing unit tests for target 383// ============================================================= 384cc_test { 385 name: "net_test_stack_ad_parser", 386 defaults: ["fluoride_defaults"], 387 test_suites: ["device-tests"], 388 local_include_dirs: [ 389 "include", 390 ], 391 srcs: [ 392 "test/ad_parser_unittest.cc", 393 ], 394 static_libs: [ 395 "libbluetooth-types", 396 "liblog", 397 "libgmock", 398 ], 399} 400 401// Bluetooth stack message loop tests for target 402// ======================================================== 403cc_test { 404 name: "net_test_btu_message_loop", 405 defaults: ["fluoride_defaults"], 406 local_include_dirs: [ 407 "include", 408 "btm", 409 ], 410 include_dirs: [ 411 "system/bt/", 412 "system/bt/internal_include", 413 "system/bt/btcore/include", 414 "system/bt/bta/include", 415 ], 416 srcs: [ 417 "btu/btu_task.cc", 418 "test/stack_btu_test.cc", 419 ], 420 shared_libs: [ 421 "liblog", 422 "libcutils", 423 "libprotobuf-cpp-lite", 424 ], 425 static_libs: [ 426 "libbt-common", 427 "libbluetooth-types", 428 "libgmock", 429 "libosi", 430 "libbt-protos-lite", 431 ], 432 sanitize: { 433 cfi: false, 434 }, 435} 436 437// Bluetooth stack connection multiplexing 438// ======================================================== 439cc_test { 440 name: "net_test_gatt_conn_multiplexing", 441 defaults: ["fluoride_defaults"], 442 local_include_dirs: [ 443 "include", 444 "btm", 445 ], 446 include_dirs: [ 447 "system/bt", 448 "system/bt/internal_include", 449 "system/bt/btcore/include", 450 "system/bt/hci/include", 451 "system/bt/internal_include", 452 "system/bt/utils/include", 453 ], 454 srcs: [ 455 "gatt/connection_manager.cc", 456 "test/gatt_connection_manager_test.cc", 457 ], 458 shared_libs: [ 459 "libcutils", 460 ], 461 static_libs: [ 462 "libbluetooth-types", 463 "liblog", 464 "libgmock", 465 ], 466 sanitize: { 467 cfi: false, 468 }, 469} 470 471cc_test { 472 name: "net_test_stack_gatt_native", 473 defaults: ["fluoride_defaults"], 474 test_suites: ["device-tests"], 475 host_supported: true, 476 include_dirs: [ 477 "system/bt", 478 "system/bt/stack/include", 479 "system/bt/stack/l2cap", 480 "system/bt/stack/btm", 481 "system/bt/utils/include", 482 ], 483 srcs: [ 484 "test/gatt/gatt_sr_test.cc", 485 "gatt/gatt_utils.cc", 486 ], 487 shared_libs: [ 488 "libcutils", 489 "libprotobuf-cpp-lite", 490 "libcrypto", 491 ], 492 static_libs: [ 493 "liblog", 494 "libosi", 495 "libbt-common", 496 "libbt-protos-lite", 497 "libosi-AllocationTestHarness", 498 ], 499 sanitize: { 500 address: true, 501 cfi: true, 502 misc_undefined: ["bounds"], 503 }, 504} 505 506cc_test { 507 name: "net_test_stack_a2dp_native", 508 defaults: ["fluoride_defaults"], 509 test_suites: ["device-tests"], 510 host_supported: true, 511 include_dirs: [ 512 "external/libldac/inc", 513 "system/bt", 514 "system/bt/stack/include", 515 ], 516 srcs: [ 517 "test/a2dp/a2dp_vendor_ldac_decoder_test.cc", 518 "test/a2dp/misc_fake.cc", 519 ], 520 shared_libs: [ 521 "libcrypto", 522 "libcutils", 523 "libprotobuf-cpp-lite", 524 ], 525 static_libs: [ 526 "libbt-common", 527 "libbt-protos-lite", 528 "liblog", 529 "libosi", 530 "libosi-AllocationTestHarness", 531 ], 532 sanitize: { 533 address: true, 534 cfi: true, 535 misc_undefined: ["bounds"], 536 }, 537} 538