blob: ff1d304cfd4022af5990bd05e7d5c35bd169eab6 [file] [log] [blame]
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_bt_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["system_bt_license"],
}
cc_defaults {
name: "fluoride_bta_defaults",
defaults: ["fluoride_basic_defaults"],
local_include_dirs: [
"include",
"sys",
"dm",
"hd",
"hh",
],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/btif/avrcp",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/gd",
"packages/modules/Bluetooth/system/internal_include",
"packages/modules/Bluetooth/system/stack/include",
"packages/modules/Bluetooth/system/stack/btm",
"packages/modules/Bluetooth/system/udrv/include",
"packages/modules/Bluetooth/system/vnd/include",
"packages/modules/Bluetooth/system/utils/include",
"packages/modules/Bluetooth/system/gd/rust/shim",
],
header_libs: ["libbluetooth_headers"],
cflags: ["-DBUILDCFG"],
}
filegroup {
name: "BtaDmSources",
srcs: [
"dm/bta_dm_act.cc",
"dm/bta_dm_api.cc",
"dm/bta_dm_cfg.cc",
"dm/bta_dm_ci.cc",
"dm/bta_dm_main.cc",
"dm/bta_dm_pm.cc",
],
}
// BTA static library for target
cc_library_static {
name: "libbt-bta",
defaults: ["fluoride_bta_defaults"],
srcs: [
":BtaDmSources",
"ag/bta_ag_act.cc",
"ag/bta_ag_api.cc",
"ag/bta_ag_at.cc",
"ag/bta_ag_cfg.cc",
"ag/bta_ag_cmd.cc",
"ag/bta_ag_main.cc",
"ag/bta_ag_rfc.cc",
"ag/bta_ag_sco.cc",
"ag/bta_ag_sdp.cc",
"ar/bta_ar.cc",
"av/bta_av_aact.cc",
"av/bta_av_act.cc",
"av/bta_av_api.cc",
"av/bta_av_cfg.cc",
"av/bta_av_ci.cc",
"av/bta_av_main.cc",
"av/bta_av_ssm.cc",
"csis/csis_client.cc",
"gatt/bta_gattc_act.cc",
"gatt/bta_gattc_api.cc",
"gatt/bta_gattc_cache.cc",
"gatt/bta_gattc_db_storage.cc",
"gatt/bta_gattc_main.cc",
"gatt/bta_gattc_queue.cc",
"gatt/bta_gattc_utils.cc",
"gatt/bta_gatts_act.cc",
"gatt/bta_gatts_api.cc",
"gatt/bta_gatts_main.cc",
"gatt/bta_gatts_queue.cc",
"gatt/bta_gatts_utils.cc",
"gatt/database.cc",
"gatt/database_builder.cc",
"groups/groups.cc",
"vc/device.cc",
"vc/vc.cc",
"le_audio/broadcaster/broadcaster.cc",
"le_audio/broadcaster/broadcaster_types.cc",
"le_audio/broadcaster/state_machine.cc",
"le_audio/client.cc",
"le_audio/codec_manager.cc",
"le_audio/devices.cc",
"le_audio/hal_verifier.cc",
"le_audio/state_machine.cc",
"le_audio/client_parser.cc",
"le_audio/client_audio.cc",
"le_audio/le_audio_set_configuration_provider.cc",
"le_audio/le_audio_set_configuration_provider_json.cc",
"le_audio/le_audio_types.cc",
"le_audio/metrics_collector.cc",
"has/has_client.cc",
"has/has_ctp.cc",
"has/has_journal.cc",
"has/has_preset.cc",
"has/has_types.cc",
"hearing_aid/hearing_aid.cc",
"hearing_aid/hearing_aid_audio_source.cc",
"hf_client/bta_hf_client_act.cc",
"hf_client/bta_hf_client_api.cc",
"hf_client/bta_hf_client_at.cc",
"hf_client/bta_hf_client_main.cc",
"hf_client/bta_hf_client_rfc.cc",
"hf_client/bta_hf_client_sco.cc",
"hf_client/bta_hf_client_sdp.cc",
"hh/bta_hh_act.cc",
"hh/bta_hh_api.cc",
"hh/bta_hh_cfg.cc",
"hh/bta_hh_le.cc",
"hh/bta_hh_main.cc",
"hh/bta_hh_utils.cc",
"hd/bta_hd_act.cc",
"hd/bta_hd_api.cc",
"hd/bta_hd_main.cc",
"jv/bta_jv_act.cc",
"jv/bta_jv_api.cc",
"jv/bta_jv_cfg.cc",
"pan/bta_pan_act.cc",
"pan/bta_pan_api.cc",
"pan/bta_pan_ci.cc",
"pan/bta_pan_main.cc",
"sdp/bta_sdp.cc",
"sdp/bta_sdp_act.cc",
"sdp/bta_sdp_api.cc",
"sdp/bta_sdp_cfg.cc",
"sys/bta_sys_conn.cc",
"sys/bta_sys_main.cc",
"sys/utl.cc",
],
static_libs: [
"avrcp-target-service",
"lib-bt-packets",
],
generated_headers: [
"LeAudioSetConfigSchemas_h",
],
host_supported: true,
min_sdk_version: "Tiramisu"
}
// bta unit tests for target
cc_test {
name: "net_test_bta",
defaults: [
"fluoride_bta_defaults",
"mts_defaults"
],
test_suites: ["device-tests"],
srcs: [
":TestMockStackBtm",
":TestCommonMockFunctions",
"test/bta_hf_client_test.cc",
"test/bta_dm_cust_uuid_test.cc",
"test/bta_dip_test.cc",
"test/gatt/database_builder_test.cc",
"test/gatt/database_builder_sample_device_test.cc",
"test/gatt/database_test.cc",
],
shared_libs: [
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"libcrypto",
"liblog",
"libprotobuf-cpp-lite",
],
static_libs: [
"crypto_toolbox_for_tests",
"libbtcore",
"libbt-bta",
"libbt-audio-hal-interface",
"libbluetooth-types",
"libbt-protos-lite",
"libosi",
"libbt-common",
],
data: [
":audio_set_scenarios_bfbs",
":audio_set_scenarios_json",
":audio_set_configurations_bfbs",
":audio_set_configurations_json",
],
}
cc_test {
name: "bt_host_test_bta",
defaults: [
"fluoride_bta_defaults",
"mts_defaults",
],
test_suites: ["device-tests"],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
],
generated_headers: [
"BluetoothGeneratedDumpsysDataSchema_h",
"BluetoothGeneratedPackets_h",
],
srcs: [
":OsiCompatSources",
":TestCommonMainHandler",
":TestMockBtif",
":TestMockDevice",
":TestMockMainShim",
":TestMockOsi",
":TestMockStack",
"ar/bta_ar.cc",
"dm/bta_dm_api.cc",
"dm/bta_dm_act.cc",
"dm/bta_dm_cfg.cc",
"dm/bta_dm_ci.cc",
"dm/bta_dm_main.cc",
"dm/bta_dm_pm.cc",
"gatt/bta_gattc_act.cc",
"gatt/bta_gattc_api.cc",
"gatt/bta_gattc_cache.cc",
"gatt/bta_gattc_db_storage.cc",
"gatt/bta_gattc_main.cc",
"gatt/bta_gattc_queue.cc",
"gatt/bta_gattc_utils.cc",
"gatt/database.cc",
"gatt/database_builder.cc",
"hh/bta_hh_act.cc",
"hh/bta_hh_api.cc",
"hh/bta_hh_cfg.cc",
"hh/bta_hh_le.cc",
"hh/bta_hh_main.cc",
"hh/bta_hh_utils.cc",
"pan/bta_pan_act.cc",
"pan/bta_pan_api.cc",
"pan/bta_pan_main.cc",
"sys/bta_sys_conn.cc",
"sys/bta_sys_main.cc",
"test/bta_dm_test.cc",
"test/bta_gatt_test.cc",
"test/bta_pan_test.cc",
],
shared_libs: [
"libbase",
"libcrypto",
"liblog",
"libprotobuf-cpp-lite",
],
static_libs: [
"libbluetooth-types",
"libbt-common",
"libbt-protos-lite",
"libbtcore",
"libflatbuffers-cpp",
"libgmock",
],
sanitize: {
address: true,
cfi: true,
misc_undefined: ["bounds"],
},
}
// bta hf client add record tests for target
cc_test {
name: "net_test_hf_client_add_record",
defaults: [
"fluoride_defaults",
"mts_defaults",
],
test_suites: ["device-tests"],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/sys",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/internal_include",
"packages/modules/Bluetooth/system/stack/include",
"packages/modules/Bluetooth/system/utils/include",
],
srcs: [
"test/bta_hf_client_add_record_test.cc",
],
header_libs: ["libbluetooth_headers"],
shared_libs: [
"libcutils",
"liblog",
],
static_libs: [
"libbluetooth-types",
"libosi",
],
cflags: ["-DBUILDCFG"],
}
// csis unit tests for host
cc_test {
name: "bluetooth_csis_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/groups",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/osi/include",
],
srcs : [
":TestMockBtif",
":TestMockMainShimLeScanning",
"csis/csis_client.cc",
"csis/csis_client_test.cc",
"groups/groups.cc",
"gatt/database.cc",
"gatt/database_builder.cc",
"test/common/bta_dm_api_mock.cc",
"test/common/bta_gatt_api_mock.cc",
"test/common/bta_gatt_queue_mock.cc",
"test/common/btm_api_mock.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
],
static_libs : [
"crypto_toolbox_for_tests",
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libosi",
],
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}
// groups unit tests for host
cc_test {
name: "bluetooth_groups_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
],
srcs : [
":TestMockBtif",
"groups/groups_test.cc",
"groups/groups.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
],
static_libs : [
"crypto_toolbox_for_tests",
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libosi",
],
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}
// bta unit tests for host
cc_test {
name: "bluetooth_vc_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/gd",
"packages/modules/Bluetooth/system/stack/include",
],
srcs : [
":TestMockOsi",
"gatt/database.cc",
"gatt/database_builder.cc",
"test/common/bta_gatt_api_mock.cc",
"test/common/bta_gatt_queue_mock.cc",
"test/common/mock_csis_client.cc",
"test/common/btm_api_mock.cc",
"vc/devices_test.cc",
"vc/device.cc",
"vc/vc.cc",
"vc/vc_test.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
],
static_libs : [
"crypto_toolbox_for_tests",
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libosi"
],
sanitize: {
cfi: false,
},
}
genrule {
name: "LeAudioSetConfigSchemas_h",
tools: [
"flatc",
],
cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -o $(genDir) --cpp $(in) ",
srcs: [
"le_audio/audio_set_configurations.fbs",
"le_audio/audio_set_scenarios.fbs",
],
out: [
"audio_set_configurations_generated.h",
"audio_set_scenarios_generated.h",
],
}
genrule {
name: "LeAudioSetScenariosSchema_bfbs",
tools: [
"flatc",
],
cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
srcs: [
"le_audio/audio_set_scenarios.fbs",
],
out: [
"audio_set_scenarios.bfbs",
],
}
genrule {
name: "LeAudioSetConfigsSchema_bfbs",
tools: [
"flatc",
],
cmd: "$(location flatc) -I packages/modules/Bluetooth/system/ -b --schema -o $(genDir) $(in) ",
srcs: [
"le_audio/audio_set_configurations.fbs",
],
out: [
"audio_set_configurations.bfbs",
],
}
prebuilt_etc {
name: "audio_set_scenarios_bfbs",
src: ":LeAudioSetScenariosSchema_bfbs",
filename: "audio_set_scenarios.bfbs",
sub_dir: "bluetooth/le_audio",
}
prebuilt_etc {
name: "audio_set_scenarios_json",
src: "le_audio/audio_set_scenarios.json",
filename_from_src: true,
sub_dir: "bluetooth/le_audio",
}
prebuilt_etc {
name: "audio_set_configurations_bfbs",
src: ":LeAudioSetConfigsSchema_bfbs",
filename: "audio_set_configurations.bfbs",
sub_dir: "bluetooth/le_audio",
}
prebuilt_etc {
name: "audio_set_configurations_json",
src: "le_audio/audio_set_configurations.json",
filename_from_src: true,
sub_dir: "bluetooth/le_audio",
}
// bta unit tests for LE Audio
// ========================================================
cc_test {
name: "bluetooth_le_audio_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
target: {
darwin: {
enabled: false,
},
android: {
cflags: [
"-DOS_ANDROID",
],
sanitize: {
misc_undefined: ["bounds"],
},
},
},
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/gd",
"packages/modules/Bluetooth/system/stack/include",
],
srcs : [
":TestStubOsi",
":TestMockBtaLeAudioHalVerifier",
"test/common/bta_gatt_api_mock.cc",
"test/common/bta_gatt_queue_mock.cc",
"test/common/btm_api_mock.cc",
"le_audio/client_audio.cc",
"le_audio/client_audio_test.cc",
"le_audio/client_parser.cc",
"le_audio/client_parser_test.cc",
"le_audio/devices.cc",
"le_audio/devices_test.cc",
"le_audio/le_audio_set_configuration_provider_json.cc",
"le_audio/le_audio_types.cc",
"le_audio/le_audio_types_test.cc",
"le_audio/metrics_collector_linux.cc",
"le_audio/mock_iso_manager.cc",
"test/common/mock_controller.cc",
"le_audio/state_machine.cc",
"le_audio/state_machine_test.cc",
"le_audio/mock_codec_manager.cc",
],
data: [
":audio_set_scenarios_bfbs",
":audio_set_scenarios_json",
":audio_set_configurations_bfbs",
":audio_set_configurations_json"
],
generated_headers: [
"LeAudioSetConfigSchemas_h",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
"liblog", // __android_log_print
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"libhidlbase",
],
static_libs : [
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libflatbuffers-cpp",
"libosi",
],
sanitize: {
cfi: false,
},
}
cc_test {
name: "bluetooth_le_audio_client_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/stack/include",
],
srcs : [
":TestStubOsi",
":TestMockBtaLeAudioHalVerifier",
"gatt/database.cc",
"gatt/database_builder.cc",
"le_audio/client.cc",
"le_audio/client_audio.cc",
"le_audio/client_parser.cc",
"le_audio/devices.cc",
"le_audio/le_audio_client_test.cc",
"le_audio/le_audio_set_configuration_provider_json.cc",
"le_audio/le_audio_types.cc",
"le_audio/metrics_collector.cc",
"le_audio/metrics_collector_test.cc",
"le_audio/mock_iso_manager.cc",
"le_audio/mock_state_machine.cc",
"test/common/btm_api_mock.cc",
"test/common/bta_gatt_api_mock.cc",
"test/common/bta_gatt_queue_mock.cc",
"test/common/btif_storage_mock.cc",
"test/common/mock_csis_client.cc",
"test/common/mock_controller.cc",
"test/common/mock_device_groups.cc",
"le_audio/mock_codec_manager.cc",
],
shared_libs: [
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"libhidlbase",
"libprotobuf-cpp-lite",
"libcrypto",
"liblog",
"libfmq",
"libbinder_ndk",
],
static_libs : [
"libbt-audio-hal-interface",
"crypto_toolbox_for_tests",
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libflatbuffers-cpp",
"libosi",
"liblc3",
],
data: [
":audio_set_scenarios_bfbs",
":audio_set_scenarios_json",
":audio_set_configurations_bfbs",
":audio_set_configurations_json",
],
generated_headers: [
"LeAudioSetConfigSchemas_h",
],
target: {
android: {
shared_libs: [
"libbinder_ndk",
"android.hardware.bluetooth.audio-V2-ndk",
],
},
},
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}
cc_test {
name: "bluetooth_test_broadcaster_sm",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/le_audio",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/stack/include",
"packages/modules/Bluetooth/system/stack/btm",
],
srcs : [
"le_audio/broadcaster/broadcaster_types.cc",
"le_audio/broadcaster/mock_ble_advertising_manager.cc",
"le_audio/broadcaster/state_machine.cc",
"le_audio/broadcaster/state_machine_test.cc",
"le_audio/le_audio_types.cc",
"le_audio/mock_iso_manager.cc",
"le_audio/mock_codec_manager.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
],
static_libs : [
"libgmock",
"libbt-common",
"libbt-protos-lite",
"liblc3",
],
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}
cc_test {
name: "bluetooth_test_broadcaster",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/le_audio",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/btif/include",
"packages/modules/Bluetooth/system/stack/include",
"packages/modules/Bluetooth/system/stack/btm",
],
srcs : [
":TestStubOsi",
"le_audio/broadcaster/broadcaster.cc",
"le_audio/broadcaster/broadcaster_test.cc",
"le_audio/broadcaster/broadcaster_types.cc",
"le_audio/broadcaster/mock_ble_advertising_manager.cc",
"le_audio/broadcaster/mock_state_machine.cc",
"le_audio/client_audio.cc",
"le_audio/le_audio_types.cc",
"le_audio/mock_iso_manager.cc",
"test/common/mock_controller.cc",
"le_audio/mock_codec_manager.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
"libfmq",
"libbinder_ndk",
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"libhidlbase",
],
static_libs : [
"libbt-audio-hal-interface",
"libgmock",
"libbt-common",
"libbt-protos-lite",
"libosi",
"liblc3",
],
target: {
android: {
shared_libs: [
"libbinder_ndk",
"android.hardware.bluetooth.audio-V2-ndk",
],
},
},
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}
cc_test {
name: "bluetooth_has_test",
test_suites: ["device-tests"],
defaults: [
"fluoride_bta_defaults",
"clang_coverage_bin",
"mts_defaults",
],
host_supported: true,
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/bta/include",
"packages/modules/Bluetooth/system/bta/test/common",
"packages/modules/Bluetooth/system/stack/include",
],
srcs : [
"gatt/database.cc",
"gatt/database_builder.cc",
"has/has_client.cc",
"has/has_client_test.cc",
"has/has_ctp.cc",
"has/has_journal.cc",
"has/has_preset.cc",
"has/has_types.cc",
"test/common/bta_gatt_api_mock.cc",
"test/common/bta_gatt_queue_mock.cc",
"test/common/btif_storage_mock.cc",
"test/common/btm_api_mock.cc",
"test/common/mock_controller.cc",
"test/common/mock_csis_client.cc",
],
shared_libs: [
"libprotobuf-cpp-lite",
"libcrypto",
],
static_libs : [
"crypto_toolbox_for_tests",
"libgmock",
"libbt-common",
"libbt-protos-lite",
],
sanitize: {
cfi: true,
scs: true,
address: true,
all_undefined: true,
integer_overflow: true,
diag: {
undefined : true
},
},
}