blob: 1a1b0cd950078e268242edd947f5e3c1f74f2d07 [file]
// MAP API module
package {
default_applicable_licenses: ["packages_apps_Bluetooth_license"],
}
// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
name: "packages_apps_Bluetooth_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
],
// large-scale-change unable to identify any license_text files
}
java_library {
name: "bluetooth.mapsapi",
srcs: ["lib/mapapi/**/*.java"],
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
sdk_version: "module_current",
lint: {
baseline_filename: "lint-baseline.xml",
},
}
java_library {
name: "mmslib",
srcs: [":framework-mms-shared-srcs"],
libs: ["unsupportedappusage"],
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
sdk_version: "module_current",
lint: {
baseline_filename: "lint-baseline.xml",
},
}
// Bluetooth JNI
cc_library_shared {
name: "libbluetooth_jni",
defaults: [
"fluoride_defaults",
"latest_android_hardware_audio_common_ndk_static",
"latest_android_hardware_bluetooth_audio_ndk_static",
"latest_android_media_audio_common_types_ndk_static",
],
srcs: ["jni/**/*.cpp"],
version_script: "libbluetooth_jni.map",
header_libs: [
"jni_headers",
"libbluetooth_headers",
],
aidl: {
libs: ["bluetooth_constants"],
},
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
],
// libbluetooth_jni is the jni lib included in the com.android.bt apex.
// As this library is inside an APEX the shared_libs that does not
// expose stubs are copied inside it. As a result using those as
// shared libraries is less interesting as they are not shared, so we link
// them statically to allow the linker to perform more optimisation.
//
// The only exception to this is libcrypto because the shared version
// is required to maintain FIPS compliance.
stl: "libc++_static",
static_libs: [
"aics",
"android.hardware.audio.common@5.0",
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"android.hardware.bluetooth@1.0",
"android.hardware.bluetooth@1.1",
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
"android.system.suspend-V1-ndk",
"android.system.suspend.control-V1-ndk",
"avrcp-target-service",
"bluetooth_flags_c_lib",
"lib-bt-packets-avrcp",
"lib-bt-packets-base",
"libFraunhoferAAC",
"libaconfig_storage_read_api_cc",
"libbase",
"libbluetooth",
"libbluetooth-types",
"libbluetooth_core_rs",
"libbluetooth_core_rs_bridge",
"libbluetooth_crypto_toolbox",
"libbluetooth_gd",
"libbluetooth_log",
"libbt-audio-asrc",
"libbt-audio-hal-interface",
"libbt-bta",
"libbt-bta-core",
"libbt-btu-main-thread",
"libbt-common",
"libbt-hci",
"libbt-jni-thread",
"libbt-sbc-decoder",
"libbt-sbc-encoder",
"libbt-stack",
"libbt-stack-core",
"libbtcore",
"libbtdevice",
"libbte",
"libbtif",
"libbtif-core",
"libchrome",
"libcutils",
"libevent",
"libexpresslog",
"libflags_rust_cpp_bridge",
"libflatbuffers-cpp",
"libfmq",
"libg722codec",
"libhidlbase",
"liblc3",
"libmodpb64",
"libopus",
"libosi",
"libprotobuf-cpp-lite",
"libstatslog_bt",
"libstatslog_express",
"libtextclassifier_hash_static",
"libudrv-uipc",
"libutils",
"server_configurable_flags",
],
shared_libs: [
"libaaudio",
"libbinder_ndk",
"libcrypto",
"liblog",
"libnativehelper",
"libstatssocket",
"libvndksupport",
],
sanitize: {
scs: true,
},
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
}
cc_library {
name: "libbluetooth-core",
defaults: ["fluoride_defaults"],
header_libs: [
"jni_headers",
"libbluetooth_headers",
],
static_libs: [
"lib-bt-packets",
"lib-bt-packets-base",
"libbt-bta-core",
"libbt-common",
"libbt-hci",
"libbt-stack-core",
"libbtcore",
"libbtdevice",
"libbte",
"libbtif-core",
"libosi",
"libbluetooth-types",
],
cflags: [
// we export all classes, so change default visibility,
// instead of having EXPORT_SYMBOL on each class
"-fvisibility=default",
],
sanitize: {
scs: true,
},
apex_available: ["com.android.bt"],
host_supported: true,
min_sdk_version: "Tiramisu",
}
android_library {
name: "BluetoothLib",
defaults: ["bluetooth_framework_errorprone_rules"],
srcs: [
":statslog-bluetooth-java-gen",
":statslog-bt-restricted-java-gen",
":system-messages-proto-src",
"proto/keystore.proto",
"src/**/*.java",
"src/**/*.kt",
],
proto: {
type: "lite",
},
libs: [
"PlatformProperties",
"bluetooth_constants_java",
"bluetooth_flags_java_lib",
"error_prone_annotations",
"framework-annotations-lib",
"framework-bluetooth-pre-jarjar",
"framework-configinfrastructure.stubs.module_lib",
"framework-connectivity-t.stubs.module_lib",
"framework-connectivity.stubs.module_lib",
"framework-location.stubs.module_lib",
"framework-media.stubs.module_lib",
"framework-mediaprovider.stubs.module_lib",
"framework-statsd.stubs.module_lib",
"framework-tethering.stubs.module_lib",
"framework-wifi.stubs.module_lib",
"modules-utils-build",
"modules-utils-expresslog",
],
static_libs: [
"BluetoothApiShims",
"android.hardware.radio-V1.0-java",
"android.hardware.radio.sap-V1-java",
"android.media.audio-aconfig-exported-java",
"android.os.flags-aconfig-java-export",
"androidx.annotation_annotation",
"androidx.core_core",
"androidx.lifecycle_lifecycle-livedata",
"androidx.media_media",
"androidx.room_room-runtime",
"bluetooth-proto-enums-java-gen",
"bluetooth-protos-lite",
"bluetooth.change-ids",
"bluetooth.mapsapi",
"com.android.obex",
"com.android.vcard",
"guava",
"libprotobuf-java-lite",
"mmslib",
"modules-utils-backgroundthread",
"modules-utils-bytesmatcher",
"modules-utils-statemachine",
"net-utils-services-common",
"networkstack-client",
"sap-api-java-static",
],
plugins: [
"androidx.room_room-compiler-plugin",
],
// Export schemas to the test directory so that we have an history
// to be able to test migrations
// The following path is absolute because a relative path doesn't work
// TODO(b/147596836): Refactor this
javacflags: ["-Aroom.schemaLocation=packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/btservice/storage/schemas"],
lint: {
error_checks: [
"Autofill",
"DefaultLocale",
"DuplicateDefinition",
// "ExportedContentProvider", // TODO: b/289445022 - enable this check
// "ExportedReceiver", // TODO: b/289445022 - enable this check
// "ExportedService", // TODO: b/289445022 - enable this check
"ExtraText",
"ExtraTranslation",
"GestureBackNavigation",
"GetterSetterNullability",
"GuardedLogInvocation",
"HandlerLeak",
"InflateParams",
// "InvalidPermission", // TODO: b/289445022 - enable this check
"LabelFor",
"MissingClass",
// "MissingVersion", // TODO: b/289445022 - enable this check
"MonochromeLauncherIcon",
"NewApi",
"ObsoleteSdkInt",
// "QueryAllPackagesPermission", // TODO: b/289445022 - enable this check
"Recycle",
"RtlHardcoded",
"RtlSymmetry",
"ScrollViewSize",
"SetTextI18n",
"SimpleDateFormat",
"StaticFieldLeak",
"StringFormatCount",
"StringFormatInvalid",
"TextFields",
"TypographyEllipsis",
"UseSparseArrays",
"UseValueOf",
"VectorPath",
"VisibleForTests",
"Wakelock",
"WakelockTimeout",
],
extra_check_modules: ["BluetoothLintChecker"],
baseline_filename: "lib-lint-baseline.xml",
},
installable: false,
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
sdk_version: "module_current",
}
// Bluetooth APK
android_app {
name: "Bluetooth",
certificate: ":com.android.bluetooth.certificate",
static_libs: ["BluetoothLib"],
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
sdk_version: "module_current",
updatable: true,
jarjar_rules: ":bluetooth-jarjar-rules",
privapp_allowlist: ":privapp_allowlist_com.android.bluetooth.xml",
jni_uses_platform_apis: true,
optimize: {
enabled: true,
shrink: true,
optimize: false,
// ignore_warnings: false, // TODO: b/191783947 -- re-activate error
proguard_flags_files: ["proguard.flags"],
},
lint: {
error_checks: [
"Autofill",
"DefaultLocale",
"DuplicateDefinition",
// "ExportedContentProvider", // TODO: b/289445022 - enable this check
// "ExportedReceiver", // TODO: b/289445022 - enable this check
// "ExportedService", // TODO: b/289445022 - enable this check
"ExtraText",
"ExtraTranslation",
"GestureBackNavigation",
"GetterSetterNullability",
"GuardedLogInvocation",
"HandlerLeak",
"InflateParams",
// "InvalidPermission", // TODO: b/289445022 - enable this check
"LabelFor",
"MissingClass",
// "MissingVersion", // TODO: b/289445022 - enable this check
"MonochromeLauncherIcon",
"NewApi",
"ObsoleteSdkInt",
// "QueryAllPackagesPermission", // TODO: b/289445022 - enable this check
"Recycle",
"RtlHardcoded",
"RtlSymmetry",
"ScrollViewSize",
"SetTextI18n",
"SimpleDateFormat",
"StaticFieldLeak",
"StringFormatCount",
"StringFormatInvalid",
"TextFields",
"TypographyEllipsis",
"UseSparseArrays",
"UseValueOf",
"VectorPath",
"VisibleForTests",
"Wakelock",
"WakelockTimeout",
],
extra_check_modules: ["BluetoothLintChecker"],
baseline_filename: "lint-baseline.xml",
},
}
java_library {
name: "bluetooth-proto-enums-java-gen",
installable: false,
proto: {
type: "stream",
},
srcs: [
":srcs_bluetooth_protos",
],
apex_available: ["com.android.bt"],
min_sdk_version: "Tiramisu",
sdk_version: "module_current",
}
genrule {
name: "statslog-bluetooth-java-gen",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --java $(out) --module bluetooth" +
" --javaPackage com.android.bluetooth --javaClass BluetoothStatsLog" +
" --minApiLevel 33",
out: ["com/android/bluetooth/BluetoothStatsLog.java"],
}
genrule {
name: "statslog-bt-restricted-java-gen",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --java $(out) --module bt_restricted" +
" --javaPackage com.android.bluetooth --javaClass BtRestrictedStatsLog" +
" --minApiLevel 34",
out: ["com/android/bluetooth/BtRestrictedStatsLog.java"],
}
android_app_certificate {
name: "com.android.bluetooth.certificate",
certificate: "certs/com.android.bluetooth",
}