blob: 81566b69c3aee60f9c5c66aa2a5293887e9f39c4 [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",
24 defaults: ["fluoride_defaults"],
25 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",
45 "packages/modules/Bluetooth/system/hci/include",
46 "packages/modules/Bluetooth/system/vnd/include",
47 "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include",
48 "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include",
49 "packages/modules/Bluetooth/system/utils/include",
50 "system/security/keystore/include",
51 "hardware/interfaces/keymaster/4.0/support/include",
52 ],
Chris Manton615296f2020-06-16 08:58:34 -070053 shared_libs: [
54 "libflatbuffers-cpp",
55 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010056 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -070057 "BluetoothGeneratedBundlerSchema_h_bfbs",
Chris Mantoned1c08b2020-06-26 22:17:14 -070058 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +010059 "BluetoothGeneratedPackets_h",
60 ],
Zach Johnsond0204152020-12-02 13:45:19 -080061 header_libs: ["libbt_callbacks_cxx_headers"],
Chris Manton878cadc2020-01-07 14:05:36 -080062 host_supported: true,
63}
64
Jack He65b2a572016-12-07 18:25:17 -080065cc_library_shared {
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070066 name: "libbluetooth",
Jack He65b2a572016-12-07 18:25:17 -080067 defaults: ["fluoride_defaults"],
Jakub Pawlowskia75a6542017-10-19 00:26:09 -070068 header_libs: ["libbluetooth_headers"],
69 export_header_lib_headers: ["libbluetooth_headers"],
Jack He65b2a572016-12-07 18:25:17 -080070 include_dirs: [
71 "packages/modules/Bluetooth/system",
72 "packages/modules/Bluetooth/system/bta/include",
73 "packages/modules/Bluetooth/system/bta/sys",
74 "packages/modules/Bluetooth/system/bta/dm",
Jakub Pawlowski9e9eb4b2017-10-17 16:40:41 -070075 "packages/modules/Bluetooth/system/internal_include",
Jack He65b2a572016-12-07 18:25:17 -080076 "packages/modules/Bluetooth/system/stack/include",
77 "packages/modules/Bluetooth/system/stack/l2cap",
78 "packages/modules/Bluetooth/system/stack/a2dp",
79 "packages/modules/Bluetooth/system/stack/btm",
80 "packages/modules/Bluetooth/system/stack/avdt",
81 "packages/modules/Bluetooth/system/udrv/include",
82 "packages/modules/Bluetooth/system/btif/include",
83 "packages/modules/Bluetooth/system/btif/co",
84 "packages/modules/Bluetooth/system/hci/include",
85 "packages/modules/Bluetooth/system/vnd/include",
86 "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include",
87 "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include",
Jack He65b2a572016-12-07 18:25:17 -080088 "packages/modules/Bluetooth/system/utils/include",
Martin Brabhamf1e57382019-02-01 13:42:58 -080089 "system/security/keystore/include",
90 "hardware/interfaces/keymaster/4.0/support/include",
Jack He65b2a572016-12-07 18:25:17 -080091 ],
92 logtags: ["../../EventLogTags.logtags"],
93 shared_libs: [
Michael Sun0e675332020-11-06 01:19:16 +000094 "libcrypto",
Chris Manton615296f2020-06-16 08:58:34 -070095 "libflatbuffers-cpp",
Jack He65b2a572016-12-07 18:25:17 -080096 "liblog",
Jack He65b2a572016-12-07 18:25:17 -080097 ],
98 static_libs: [
Chris Manton878cadc2020-01-07 14:05:36 -080099 "libbte",
Jack He65b2a572016-12-07 18:25:17 -0800100 "libbt-sbc-decoder",
101 "libbt-sbc-encoder",
Pavlin Radoslavov262b15d2017-01-03 16:53:18 -0800102 "libFraunhoferAAC",
Jakub Pawlowskif9a0e632017-11-24 15:19:54 -0800103 "libg722codec",
Grzegorz Kołodziejczyk926fd432021-10-06 11:54:53 +0000104 "liblc3codec",
Jakub Pawlowskid0a41af2022-01-03 17:53:02 +0100105 "liblc3",
Jack He65b2a572016-12-07 18:25:17 -0800106 "libudrv-uipc",
Hansong Zhang4232fa82021-08-13 18:28:47 -0700107 "libprotobuf-cpp-lite",
Chris Manton28c4c582019-09-09 21:11:59 -0700108 "libbluetooth_gd", // Gabeldorsche
Chris Mantone0e56d82021-10-21 08:09:51 -0700109 "libbluetooth-dumpsys",
Zach Johnsona5a04022020-12-09 00:39:55 +0000110 "libbluetooth_rust_interop",
Jack He65b2a572016-12-07 18:25:17 -0800111 ],
112 whole_static_libs: [
113 "libbt-bta",
Jack He63d2fa32018-07-25 21:43:01 -0700114 "libbt-common",
Jack He65b2a572016-12-07 18:25:17 -0800115 "libbtdevice",
116 "libbtif",
117 "libbt-hci",
Jack He65b2a572016-12-07 18:25:17 -0800118 "libbt-stack",
119 "libbt-utils",
120 "libbtcore",
121 "libosi",
Jack He9a30a9f2018-03-03 00:03:25 -0800122 "libbt-protos-lite",
Jack He65b2a572016-12-07 18:25:17 -0800123 ],
Hansong Zhang0769e702021-03-01 17:52:04 -0800124 target: {
125 android: {
126 shared_libs: [
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700127 "android.hardware.bluetooth.a2dp@1.0",
128 "android.hardware.bluetooth.audio@2.0",
129 "android.hardware.bluetooth.audio@2.1",
Alice Kuoc5275a32021-11-08 22:42:52 +0800130 "android.hardware.bluetooth.audio@2.2",
Josh Wu28d6da12021-12-22 06:13:40 -0800131 "android.hardware.bluetooth.audio-V1-ndk",
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700132 "android.hardware.bluetooth@1.0",
133 "android.hardware.bluetooth@1.1",
Hansong Zhang0769e702021-03-01 17:52:04 -0800134 "android.system.suspend.control-V1-ndk",
Jiyong Parkf83675d2021-07-27 12:18:38 +0900135 "android.system.suspend-V1-ndk",
Hansong Zhang0769e702021-03-01 17:52:04 -0800136 "libaaudio",
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700137 "libbinder_ndk",
138 "libcutils",
139 "libhidlbase",
Hansong Zhang0769e702021-03-01 17:52:04 -0800140 "libfmq",
Hansong Zhang4232fa82021-08-13 18:28:47 -0700141 "libprocessgroup",
142 "libtinyxml2",
143 "libutils",
Hansong Zhanga990e9c2021-08-13 14:50:19 -0700144 "libz",
Hansong Zhang0769e702021-03-01 17:52:04 -0800145 ],
146 required: [
147 "libldacBT_enc",
148 "libldacBT_abr",
149 ],
150 },
151 },
Jack He65b2a572016-12-07 18:25:17 -0800152 // Shared library link options.
153 // References to global symbols and functions should bind to the library
154 // itself. This is to avoid issues with some of the unit/system tests
155 // that might link statically with some of the code in the library, and
156 // also dlopen(3) the shared library.
157 ldflags: ["-Wl,-Bsymbolic,-Bsymbolic-functions"],
158 required: [
159 "bt_did.conf",
160 "bt_stack.conf",
Jack He65b2a572016-12-07 18:25:17 -0800161 ],
162 cflags: [
163 "-DBUILDCFG",
164 ],
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800165 sanitize: {
Hansong Zhang0769e702021-03-01 17:52:04 -0800166 never: true,
Peter Collingbournefc97afd2018-12-06 17:04:43 -0800167 },
Roopa Sattiraju29b37332021-12-23 12:32:03 -0800168 apex_available: [
169 "//apex_available:platform",
170 "com.android.bluetooth",
171 ],
Hansong Zhang0769e702021-03-01 17:52:04 -0800172 host_supported: true,
Roopa Sattiraju29b37332021-12-23 12:32:03 -0800173 min_sdk_version: "30",
Jack He65b2a572016-12-07 18:25:17 -0800174}
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700175
176cc_library_static {
177 name: "libbluetooth-for-tests",
178 defaults: ["fluoride_defaults"],
179
180 srcs: [
Chris Manton28c4c582019-09-09 21:11:59 -0700181 ":LibBluetoothSources",
Chris Manton011f6a72019-12-15 13:20:13 -0800182 ":LibBluetoothShimSources",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700183 ],
Chris Manton3ee967b2019-11-05 11:39:07 -0800184 host_supported: true,
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700185 include_dirs: [
186 "packages/modules/Bluetooth/system",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100187 "packages/modules/Bluetooth/system/gd",
Zach Johnsond0204152020-12-02 13:45:19 -0800188 "packages/modules/Bluetooth/system/gd/rust/shim",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700189 "packages/modules/Bluetooth/system/bta/include",
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700190 "packages/modules/Bluetooth/system/btif/include",
191 "packages/modules/Bluetooth/system/hci/include",
192 "packages/modules/Bluetooth/system/internal_include",
193 "packages/modules/Bluetooth/system/stack/include",
194 "packages/modules/Bluetooth/system/utils/include",
195 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100196 generated_headers: [
Chris Manton2e143092020-07-22 12:42:20 -0700197 "BluetoothGeneratedBundlerSchema_h_bfbs",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100198 "BluetoothGeneratedPackets_h",
Chris Mantoned1c08b2020-06-26 22:17:14 -0700199 "BluetoothGeneratedDumpsysDataSchema_h",
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100200 ],
Pavlin Radoslavov96e9e342017-11-02 14:27:09 -0700201 cflags: [
202 "-DBUILDCFG",
203 ],
Chris Manton615296f2020-06-16 08:58:34 -0700204 shared_libs: [
205 "libflatbuffers-cpp",
206 ],
Jakub Pawlowskid4e47052020-02-16 01:03:04 +0100207 whole_static_libs: [
208 "libbluetooth_gd", // Gabeldorsche
Chris Manton3ee967b2019-11-05 11:39:07 -0800209 ],
210}
Chris Mantone6a57a22021-03-05 12:25:19 -0800211
212cc_test {
213 name: "net_test_main_shim",
214 test_suites: ["device-tests"],
215 host_supported: true,
216 test_options: {
217 unit_test: true,
218 },
219 defaults: ["fluoride_defaults"],
220 include_dirs: [
221 "packages/modules/Bluetooth/system",
222 "packages/modules/Bluetooth/system/gd",
223 "packages/modules/Bluetooth/system/stack/include",
224 ],
225 srcs: [
Chris Manton847dc382021-05-12 10:08:48 -0700226 ":TestCommonMainHandler",
Chris Manton47ee7b32021-04-26 17:12:53 -0700227 ":TestMockBta",
228 ":TestMockBtif",
229 ":TestMockLegacyHciCommands",
Chris Manton3a349d02021-11-16 19:52:11 -0800230 ":TestMockLegacyHciInterface",
Chris Manton47ee7b32021-04-26 17:12:53 -0700231 ":TestMockMainShimEntry",
232 ":TestMockStack",
Chris Mantone6a57a22021-03-05 12:25:19 -0800233 "shim/acl_api.cc",
234 "shim/acl.cc",
235 "shim/acl_legacy_interface.cc",
236 "shim/btm_api.cc",
237 "shim/btm.cc",
238 "shim/config.cc",
239 "shim/controller.cc",
240 "shim/dumpsys.cc",
241 "shim/hci_layer.cc",
242 "shim/l2c_api.cc",
243 "shim/le_advertising_manager.cc",
244 "shim/le_scanning_manager.cc",
245 "shim/link_policy.cc",
Chen Chen534bf242021-03-10 15:41:42 -0800246 "shim/metric_id_api.cc",
247 "shim/metrics_api.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800248 "shim/shim.cc",
249 "shim/stack.cc",
Chris Mantonca01f582022-01-07 13:00:31 -0800250 "test/common_stack_test.cc",
Chris Mantone6a57a22021-03-05 12:25:19 -0800251 "test/main_shim_test.cc",
252 ],
253 static_libs: [
Chris Mantone0e56d82021-10-21 08:09:51 -0700254 "libbluetooth-dumpsys",
Chris Mantone6a57a22021-03-05 12:25:19 -0800255 "libbt-common",
256 "libbt-protos-lite",
257 "libgmock",
258 "liblog",
259 "libosi",
260 "libbtdevice",
261 ],
262 shared_libs: [
263 "libcrypto",
264 "libflatbuffers-cpp",
265 "libprotobuf-cpp-lite",
266 ],
267 sanitize: {
268 address: true,
269 all_undefined: true,
270 cfi: true,
271 integer_overflow: true,
272 scs: true,
273 diag: {
274 undefined : true
275 },
276 },
277 generated_headers: [
278 "BluetoothGeneratedBundlerSchema_h_bfbs",
279 "BluetoothGeneratedDumpsysDataSchema_h",
Chris Mantone6a57a22021-03-05 12:25:19 -0800280 "BluetoothGeneratedPackets_h",
281 ],
282}