1// MAP API module
2
3package {
4    default_applicable_licenses: ["packages_apps_Bluetooth_license"],
5}
6
7// Added automatically by a large-scale-change that took the approach of
8// 'apply every license found to every target'. While this makes sure we respect
9// every license restriction, it may not be entirely correct.
10//
11// e.g. GPL in an MIT project might only apply to the contrib/ directory.
12//
13// Please consider splitting the single license below into multiple licenses,
14// taking care not to lose any license_kind information, and overriding the
15// default license using the 'licenses: [...]' property on targets as needed.
16//
17// For unused files, consider creating a 'fileGroup' with "//visibility:private"
18// to attach the license to, and including a comment whether the files may be
19// used in the current project.
20// See: http://go/android-license-faq
21license {
22    name: "packages_apps_Bluetooth_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-Apache-2.0",
26        "SPDX-license-identifier-BSD",
27    ],
28    // large-scale-change unable to identify any license_text files
29}
30
31java_library {
32    name: "bluetooth.mapsapi",
33
34    srcs: ["lib/mapapi/**/*.java"],
35}
36
37// Bluetooth JNI
38
39cc_library_shared {
40    name: "libbluetooth_jni",
41    srcs: ["jni/**/*.cpp"],
42    header_libs: [
43        "jni_headers",
44        "libbluetooth_headers",
45    ],
46    include_dirs: [
47        "system/bt/types",
48    ],
49    shared_libs: [
50        "libbase",
51        "libchrome",
52        "liblog",
53        "libnativehelper",
54    ],
55    static_libs: [
56        "libbluetooth-types",
57    ],
58    cflags: [
59        "-Wall",
60        "-Werror",
61        "-Wextra",
62        "-Wno-unused-parameter",
63    ],
64    sanitize: {
65        scs: true,
66    },
67}
68
69// Bluetooth APK
70
71android_app {
72    name: "Bluetooth",
73    defaults: ["platform_app_defaults"],
74
75    srcs: [
76        "src/**/*.java",
77        ":statslog-bluetooth-java-gen",
78    ],
79    platform_apis: true,
80    certificate: "platform",
81
82    jni_libs: ["libbluetooth_jni"],
83    libs: [
84        "javax.obex",
85        "services.net",
86    ],
87    static_libs: [
88        "com.android.vcard",
89        "bluetooth.mapsapi",
90        "sap-api-java-static",
91        "services.net",
92        "libprotobuf-java-lite",
93        "bluetooth-protos-lite",
94        "androidx.core_core",
95        "androidx.legacy_legacy-support-v4",
96        "androidx.lifecycle_lifecycle-livedata",
97        "androidx.room_room-runtime",
98        "guava",
99    ],
100
101    plugins: [
102        "androidx.room_room-compiler-plugin",
103    ],
104
105    // Add in path to Bluetooth directory because local path does not exist
106    javacflags: ["-Aroom.schemaLocation=packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/storage/schemas"],
107
108    optimize: {
109        enabled: false,
110    },
111    required: ["libbluetooth"],
112    apex_available: [
113        "//apex_available:platform",
114        "com.android.bluetooth.updatable",
115    ],
116    errorprone: {
117        javacflags: [
118            // "-Xep:AndroidFrameworkRequiresPermission:ERROR",
119        ],
120    },
121}
122
123genrule {
124    name: "statslog-bluetooth-java-gen",
125    tools: ["stats-log-api-gen"],
126    cmd: "$(location stats-log-api-gen) --java $(out) --module bluetooth"
127        + " --javaPackage com.android.bluetooth --javaClass BluetoothStatsLog --worksource",
128    out: ["com/android/bluetooth/BluetoothStatsLog.java"],
129}
130