blob: 37acf2429df8321a0b4d203ca8f3edd82152a1f1 [file] [log] [blame]
Jack He65b2a572016-12-07 18:25:17 -08001// Bluetooth main HW module / shared library for target
Bob Badour92ecf7c2021-02-12 18:05:29 -08002package {
3 // See: http://go/android-license-faq
4 // A large-scale-change added 'default_applicable_licenses' to import
5 // all of the 'license_kinds' from "system_bt_license"
6 // to get the below license kinds:
7 // SPDX-license-identifier-Apache-2.0
8 default_applicable_licenses: ["system_bt_license"],
9}
10
Chris Manton28c4c582019-09-09 21:11:59 -070011filegroup {
12 name: "LibBluetoothSources",
13 srcs: [
14 "bte_conf.cc",
Chris Manton28c4c582019-09-09 21:11:59 -070015 "bte_init_cpp_logging.cc",
16 "bte_logmsg.cc",
17 "bte_main.cc",
Chris Manton28c4c582019-09-09 21:11:59 -070018 "stack_config.cc",
19 ]
20}
21
Chris Manton878cadc2020-01-07 14:05:36 -080022cc_library_static {
23 name: "libbte",
Richard Gaywoode634b3d2022-03-10 10:55:06 +000024 defaults: ["fluoride_defaults"],
Chris Manton878cadc2020-01-07 14:05:36 -080025 srcs: [
26 ":LibBluetoothSources",
27 ":LibBluetoothShimSources",
28 ],
29 include_dirs: [
30 "packages/modules/Bluetooth/system",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010031 "packages/modules/Bluetooth/system/gd",
Zach Johnsond0204152020-12-02 13:45:19 -080032 "packages/modules/Bluetooth/system/gd/rust/shim",
Chris Manton878cadc2020-01-07 14:05:36 -080033 "packages/modules/Bluetooth/system/bta/include",
34 "packages/modules/Bluetooth/system/bta/sys",
35 "packages/modules/Bluetooth/system/bta/dm",
Chris Manton878cadc2020-01-07 14:05:36 -080036 "packages/modules/Bluetooth/system/internal_include",
37 "packages/modules/Bluetooth/system/stack/include",
38 "packages/modules/Bluetooth/system/stack/l2cap",
39 "packages/modules/Bluetooth/system/stack/a2dp",
40 "packages/modules/Bluetooth/system/stack/btm",
41 "packages/modules/Bluetooth/system/stack/avdt",
42 "packages/modules/Bluetooth/system/udrv/include",
43 "packages/modules/Bluetooth/system/btif/include",
44 "packages/modules/Bluetooth/system/btif/co",
Chris Manton878cadc2020-01-07 14:05:36 -080045 "packages/modules/Bluetooth/system/vnd/include",
46 "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include",
47 "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include",
48 "packages/modules/Bluetooth/system/utils/include",
49 "system/security/keystore/include",
50 "hardware/interfaces/keymaster/4.0/support/include",
51 ],
Richard Gaywoode634b3d2022-03-10 10:55:06 +000052 shared_libs: [
53 "libflatbuffers-cpp",
54 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010055 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -070056 "BluetoothGeneratedBundlerSchema_h_bfbs",
Chris Mantoned1c08b2020-06-26 22:17:14 -070057 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010058 "BluetoothGeneratedPackets_h",
59 ],
Zach Johnsond0204152020-12-02 13:45:19 -080060 header_libs: ["libbt_callbacks_cxx_headers"],
Chris Manton878cadc2020-01-07 14:05:36 -080061 host_supported: true,
ahujapalash5add3d52022-03-10 18:38:02 +000062 min_sdk_version: "Tiramisu"
Chris Manton878cadc2020-01-07 14:05:36 -080063}
64
Richard Gaywoode634b3d2022-03-10 10:55:06 +000065cc_library_shared {
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070066 name: "libbluetooth",
Etienne Ruffieux917abc32022-02-28 14:07:17 +000067 visibility: [
68 "//cts/hostsidetests:__subpackages__",
69 "//packages/modules/Bluetooth:__subpackages__",
70 "//vendor:__subpackages__",
71 ],
Richard Gaywoode634b3d2022-03-10 10:55:06 +000072 defaults: ["fluoride_defaults"],
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070073 header_libs: ["libbluetooth_headers"],
74 export_header_lib_headers: ["libbluetooth_headers"],
Jack He65b2a572016-12-07 18:25:17 -080075 include_dirs: [
76 "packages/modules/Bluetooth/system",
77 "packages/modules/Bluetooth/system/bta/include",
78 "packages/modules/Bluetooth/system/bta/sys",
79 "packages/modules/Bluetooth/system/bta/dm",
Jakub Pawlowski9e9eb4b2017-10-17 16:40:41 -070080 "packages/modules/Bluetooth/system/internal_include",
Jack He65b2a572016-12-07 18:25:17 -080081 "packages/modules/Bluetooth/system/stack/include",
82 "packages/modules/Bluetooth/system/stack/l2cap",
83 "packages/modules/Bluetooth/system/stack/a2dp",
84 "packages/modules/Bluetooth/system/stack/btm",
85 "packages/modules/Bluetooth/system/stack/avdt",
86 "packages/modules/Bluetooth/system/udrv/include",
87 "packages/modules/Bluetooth/system/btif/include",
88 "packages/modules/Bluetooth/system/btif/co",
Jack He65b2a572016-12-07 18:25:17 -080089 "packages/modules/Bluetooth/system/vnd/include",
90 "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include",
91 "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include",
Jack He65b2a572016-12-07 18:25:17 -080092 "packages/modules/Bluetooth/system/utils/include",
Martin Brabhamf1e57382019-02-01 13:42:58 -080093 "system/security/keystore/include",
94 "hardware/interfaces/keymaster/4.0/support/include",
Jack He65b2a572016-12-07 18:25:17 -080095 ],
96 logtags: ["../../EventLogTags.logtags"],
Richard Gaywoode634b3d2022-03-10 10:55:06 +000097 shared_libs: [
98 "libcrypto",
99 "libflatbuffers-cpp",
100 "liblog",
101 ],
102 static_libs: [
103 "libbte",
104 "libbt-sbc-decoder",
105 "libbt-sbc-encoder",
106 "libFraunhoferAAC",
107 "libg722codec",
108 "liblc3",
109 "libudrv-uipc",
110 "libprotobuf-cpp-lite",
111 "libbluetooth_gd", // Gabeldorsche
112 "libbluetooth-dumpsys",
113 "libbluetooth_rust_interop",
114 ],
115 whole_static_libs: [
116 "libbt-bta",
117 "libbt-common",
118 "libbtdevice",
119 "libbtif",
120 "libbt-hci",
121 "libbt-stack",
122 "libbt-utils",
123 "libbtcore",
124 "libosi",
125 "libbt-protos-lite",
126 ],
127 target: {
128 android: {
129 shared_libs: [
130 "android.hardware.bluetooth.a2dp@1.0",
131 "android.hardware.bluetooth.audio@2.0",
132 "android.hardware.bluetooth.audio@2.1",
133 "android.hardware.bluetooth.audio-V1-ndk",
134 "android.hardware.bluetooth@1.0",
135 "android.hardware.bluetooth@1.1",
136 "android.system.suspend.control-V1-ndk",
137 "android.system.suspend-V1-ndk",
138 "libaaudio",
139 "libbinder_ndk",
140 "libcutils",
141 "libhidlbase",
142 "libfmq",
143 "libprocessgroup",
144 "libtinyxml2",
145 "libutils",
146 "libz",
147 ],
148 required: [
149 "libldacBT_enc",
150 "libldacBT_abr",
151 ],
152 },
153 },
Jack He65b2a572016-12-07 18:25:17 -0800154 // Shared library link options.
155 // References to global symbols and functions should bind to the library
156 // itself. This is to avoid issues with some of the unit/system tests
157 // that might link statically with some of the code in the library, and
158 // also dlopen(3) the shared library.
159 ldflags: ["-Wl,-Bsymbolic,-Bsymbolic-functions"],
160 required: [
161 "bt_did.conf",
162 "bt_stack.conf",
Jakub Tyszkowskifa3e4cb2022-01-25 15:52:01 +0000163 "audio_set_scenarios_bfbs",
164 "audio_set_scenarios_json",
165 "audio_set_configurations_bfbs",
166 "audio_set_configurations_json",
Jack He65b2a572016-12-07 18:25:17 -0800167 ],
168 cflags: [
169 "-DBUILDCFG",
170 ],
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800171 sanitize: {
Hansong Zhang0769e702021-03-01 17:52:04 -0800172 never: true,
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800173 },
Richard Gaywoode634b3d2022-03-10 10:55:06 +0000174 apex_available: [
175 "//apex_available:platform",
176 "com.android.bluetooth",
177 ],
Hansong Zhang0769e702021-03-01 17:52:04 -0800178 host_supported: true,
Roopa Sattiraju29b37332021-12-23 12:32:03 -0800179 min_sdk_version: "30",
Jack He65b2a572016-12-07 18:25:17 -0800180}
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700181
182cc_library_static {
183 name: "libbluetooth-for-tests",
184 defaults: ["fluoride_defaults"],
185
186 srcs: [
Chris Manton28c4c582019-09-09 21:11:59 -0700187 ":LibBluetoothSources",
Chris Manton011f6a72019-12-15 13:20:13 -0800188 ":LibBluetoothShimSources",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700189 ],
Chris Manton3ee967b2019-11-05 11:39:07 -0800190 host_supported: true,
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700191 include_dirs: [
192 "packages/modules/Bluetooth/system",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100193 "packages/modules/Bluetooth/system/gd",
Zach Johnsond0204152020-12-02 13:45:19 -0800194 "packages/modules/Bluetooth/system/gd/rust/shim",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700195 "packages/modules/Bluetooth/system/bta/include",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700196 "packages/modules/Bluetooth/system/btif/include",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700197 "packages/modules/Bluetooth/system/internal_include",
198 "packages/modules/Bluetooth/system/stack/include",
199 "packages/modules/Bluetooth/system/utils/include",
200 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100201 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -0700202 "BluetoothGeneratedBundlerSchema_h_bfbs",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100203 "BluetoothGeneratedPackets_h",
Chris Mantoned1c08b2020-06-26 22:17:14 -0700204 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100205 ],
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700206 cflags: [
207 "-DBUILDCFG",
208 ],
Chris Manton615296f2020-06-16 08:58:34 -0700209 shared_libs: [
210 "libflatbuffers-cpp",
211 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100212 whole_static_libs: [
213 "libbluetooth_gd", // Gabeldorsche
Chris Manton3ee967b2019-11-05 11:39:07 -0800214 ],
215}
Chris Mantone6a57a22021-03-05 12:25:19 -0800216
217cc_test {
218 name: "net_test_main_shim",
219 test_suites: ["device-tests"],
220 host_supported: true,
221 test_options: {
222 unit_test: true,
223 },
224 defaults: ["fluoride_defaults"],
225 include_dirs: [
226 "packages/modules/Bluetooth/system",
227 "packages/modules/Bluetooth/system/gd",
228 "packages/modules/Bluetooth/system/stack/include",
229 ],
230 srcs: [
Chris Manton847dc382021-05-12 10:08:48 -0700231 ":TestCommonMainHandler",
Chris Mantonec5dedb2022-01-30 16:58:59 -0800232 ":TestCommonMockFunctions",
Chris Manton47ee7b32021-04-26 17:12:53 -0700233 ":TestMockBta",
234 ":TestMockBtif",
235 ":TestMockLegacyHciCommands",
Chris Manton3a349d02021-11-16 19:52:11 -0800236 ":TestMockLegacyHciInterface",
Chris Manton47ee7b32021-04-26 17:12:53 -0700237 ":TestMockMainShimEntry",
238 ":TestMockStack",
Chris Mantone6a57a22021-03-05 12:25:19 -0800239 "shim/acl_api.cc",
240 "shim/acl.cc",
241 "shim/acl_legacy_interface.cc",
242 "shim/btm_api.cc",
243 "shim/btm.cc",
244 "shim/config.cc",
245 "shim/controller.cc",
246 "shim/dumpsys.cc",
247 "shim/hci_layer.cc",
248 "shim/l2c_api.cc",
249 "shim/le_advertising_manager.cc",
250 "shim/le_scanning_manager.cc",
251 "shim/link_policy.cc",
Chen Chen534bf242021-03-10 15:41:42 -0800252 "shim/metric_id_api.cc",
253 "shim/metrics_api.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800254 "shim/shim.cc",
255 "shim/stack.cc",
Chris Mantonca01f582022-01-07 13:00:31 -0800256 "test/common_stack_test.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800257 "test/main_shim_test.cc",
258 ],
259 static_libs: [
Chris Mantone0e56d82021-10-21 08:09:51 -0700260 "libbluetooth-dumpsys",
Chris Mantone6a57a22021-03-05 12:25:19 -0800261 "libbt-common",
262 "libbt-protos-lite",
263 "libgmock",
264 "liblog",
265 "libosi",
266 "libbtdevice",
267 ],
268 shared_libs: [
269 "libcrypto",
Richard Gaywoode634b3d2022-03-10 10:55:06 +0000270 "libflatbuffers-cpp",
Chris Mantone6a57a22021-03-05 12:25:19 -0800271 "libprotobuf-cpp-lite",
272 ],
273 sanitize: {
274 address: true,
275 all_undefined: true,
276 cfi: true,
277 integer_overflow: true,
278 scs: true,
279 diag: {
280 undefined : true
281 },
282 },
283 generated_headers: [
284 "BluetoothGeneratedBundlerSchema_h_bfbs",
285 "BluetoothGeneratedDumpsysDataSchema_h",
Chris Mantone6a57a22021-03-05 12:25:19 -0800286 "BluetoothGeneratedPackets_h",
287 ],
ahujapalash5add3d52022-03-10 18:38:02 +0000288 min_sdk_version: "Tiramisu"
Chris Mantone6a57a22021-03-05 12:25:19 -0800289}