Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 1 | // Bluetooth main HW module / shared library for target |
Bob Badour | 92ecf7c | 2021-02-12 18:05:29 -0800 | [diff] [blame] | 2 | package { |
| 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 Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 11 | filegroup { |
| 12 | name: "LibBluetoothSources", |
| 13 | srcs: [ |
| 14 | "bte_conf.cc", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 15 | "bte_init_cpp_logging.cc", |
| 16 | "bte_logmsg.cc", |
| 17 | "bte_main.cc", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 18 | "stack_config.cc", |
| 19 | ] |
| 20 | } |
| 21 | |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 22 | cc_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 Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 31 | "packages/modules/Bluetooth/system/gd", |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 32 | "packages/modules/Bluetooth/system/gd/rust/shim", |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 33 | "packages/modules/Bluetooth/system/bta/include", |
| 34 | "packages/modules/Bluetooth/system/bta/sys", |
| 35 | "packages/modules/Bluetooth/system/bta/dm", |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 36 | "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 Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 53 | shared_libs: [ |
| 54 | "libflatbuffers-cpp", |
| 55 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 56 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 57 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 58 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 59 | "BluetoothGeneratedPackets_h", |
| 60 | ], |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 61 | header_libs: ["libbt_callbacks_cxx_headers"], |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 62 | host_supported: true, |
| 63 | } |
| 64 | |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 65 | cc_library_shared { |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 66 | name: "libbluetooth", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 67 | defaults: ["fluoride_defaults"], |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 68 | header_libs: ["libbluetooth_headers"], |
| 69 | export_header_lib_headers: ["libbluetooth_headers"], |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 70 | 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 Pawlowski | 9e9eb4b | 2017-10-17 16:40:41 -0700 | [diff] [blame] | 75 | "packages/modules/Bluetooth/system/internal_include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 76 | "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 He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 88 | "packages/modules/Bluetooth/system/utils/include", |
Martin Brabham | f1e5738 | 2019-02-01 13:42:58 -0800 | [diff] [blame] | 89 | "system/security/keystore/include", |
| 90 | "hardware/interfaces/keymaster/4.0/support/include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 91 | ], |
| 92 | logtags: ["../../EventLogTags.logtags"], |
| 93 | shared_libs: [ |
Michael Sun | 0e67533 | 2020-11-06 01:19:16 +0000 | [diff] [blame] | 94 | "libcrypto", |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 95 | "libflatbuffers-cpp", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 96 | "liblog", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 97 | ], |
| 98 | static_libs: [ |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 99 | "libbte", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 100 | "libbt-sbc-decoder", |
| 101 | "libbt-sbc-encoder", |
Pavlin Radoslavov | 262b15d | 2017-01-03 16:53:18 -0800 | [diff] [blame] | 102 | "libFraunhoferAAC", |
Jakub Pawlowski | f9a0e63 | 2017-11-24 15:19:54 -0800 | [diff] [blame] | 103 | "libg722codec", |
Grzegorz Kołodziejczyk | 926fd43 | 2021-10-06 11:54:53 +0000 | [diff] [blame] | 104 | "liblc3codec", |
Jakub Pawlowski | d0a41af | 2022-01-03 17:53:02 +0100 | [diff] [blame] | 105 | "liblc3", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 106 | "libudrv-uipc", |
Hansong Zhang | 4232fa8 | 2021-08-13 18:28:47 -0700 | [diff] [blame] | 107 | "libprotobuf-cpp-lite", |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 108 | "libbluetooth_gd", // Gabeldorsche |
Chris Manton | e0e56d8 | 2021-10-21 08:09:51 -0700 | [diff] [blame] | 109 | "libbluetooth-dumpsys", |
Zach Johnson | a5a0402 | 2020-12-09 00:39:55 +0000 | [diff] [blame] | 110 | "libbluetooth_rust_interop", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 111 | ], |
| 112 | whole_static_libs: [ |
| 113 | "libbt-bta", |
Jack He | 63d2fa3 | 2018-07-25 21:43:01 -0700 | [diff] [blame] | 114 | "libbt-common", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 115 | "libbtdevice", |
| 116 | "libbtif", |
| 117 | "libbt-hci", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 118 | "libbt-stack", |
| 119 | "libbt-utils", |
| 120 | "libbtcore", |
| 121 | "libosi", |
Jack He | 9a30a9f | 2018-03-03 00:03:25 -0800 | [diff] [blame] | 122 | "libbt-protos-lite", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 123 | ], |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 124 | target: { |
| 125 | android: { |
| 126 | shared_libs: [ |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame] | 127 | "android.hardware.bluetooth.a2dp@1.0", |
| 128 | "android.hardware.bluetooth.audio@2.0", |
| 129 | "android.hardware.bluetooth.audio@2.1", |
Alice Kuo | c5275a3 | 2021-11-08 22:42:52 +0800 | [diff] [blame] | 130 | "android.hardware.bluetooth.audio@2.2", |
Josh Wu | 28d6da1 | 2021-12-22 06:13:40 -0800 | [diff] [blame] | 131 | "android.hardware.bluetooth.audio-V1-ndk", |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame] | 132 | "android.hardware.bluetooth@1.0", |
| 133 | "android.hardware.bluetooth@1.1", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 134 | "android.system.suspend.control-V1-ndk", |
Jiyong Park | f83675d | 2021-07-27 12:18:38 +0900 | [diff] [blame] | 135 | "android.system.suspend-V1-ndk", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 136 | "libaaudio", |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame] | 137 | "libbinder_ndk", |
| 138 | "libcutils", |
| 139 | "libhidlbase", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 140 | "libfmq", |
Hansong Zhang | 4232fa8 | 2021-08-13 18:28:47 -0700 | [diff] [blame] | 141 | "libprocessgroup", |
| 142 | "libtinyxml2", |
| 143 | "libutils", |
Hansong Zhang | a990e9c | 2021-08-13 14:50:19 -0700 | [diff] [blame] | 144 | "libz", |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 145 | ], |
| 146 | required: [ |
| 147 | "libldacBT_enc", |
| 148 | "libldacBT_abr", |
| 149 | ], |
| 150 | }, |
| 151 | }, |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 152 | // 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 He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 161 | ], |
| 162 | cflags: [ |
| 163 | "-DBUILDCFG", |
| 164 | ], |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 165 | sanitize: { |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 166 | never: true, |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 167 | }, |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 168 | host_supported: true, |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 169 | } |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 170 | |
| 171 | cc_library_static { |
| 172 | name: "libbluetooth-for-tests", |
| 173 | defaults: ["fluoride_defaults"], |
| 174 | |
| 175 | srcs: [ |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 176 | ":LibBluetoothSources", |
Chris Manton | 011f6a7 | 2019-12-15 13:20:13 -0800 | [diff] [blame] | 177 | ":LibBluetoothShimSources", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 178 | ], |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 179 | host_supported: true, |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 180 | include_dirs: [ |
| 181 | "packages/modules/Bluetooth/system", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 182 | "packages/modules/Bluetooth/system/gd", |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 183 | "packages/modules/Bluetooth/system/gd/rust/shim", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 184 | "packages/modules/Bluetooth/system/bta/include", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 185 | "packages/modules/Bluetooth/system/btif/include", |
| 186 | "packages/modules/Bluetooth/system/hci/include", |
| 187 | "packages/modules/Bluetooth/system/internal_include", |
| 188 | "packages/modules/Bluetooth/system/stack/include", |
| 189 | "packages/modules/Bluetooth/system/utils/include", |
| 190 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 191 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 192 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 193 | "BluetoothGeneratedPackets_h", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 194 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 195 | ], |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 196 | cflags: [ |
| 197 | "-DBUILDCFG", |
| 198 | ], |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 199 | shared_libs: [ |
| 200 | "libflatbuffers-cpp", |
| 201 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 202 | whole_static_libs: [ |
| 203 | "libbluetooth_gd", // Gabeldorsche |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 204 | ], |
| 205 | } |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 206 | |
| 207 | cc_test { |
| 208 | name: "net_test_main_shim", |
| 209 | test_suites: ["device-tests"], |
| 210 | host_supported: true, |
| 211 | test_options: { |
| 212 | unit_test: true, |
| 213 | }, |
| 214 | defaults: ["fluoride_defaults"], |
| 215 | include_dirs: [ |
| 216 | "packages/modules/Bluetooth/system", |
| 217 | "packages/modules/Bluetooth/system/gd", |
| 218 | "packages/modules/Bluetooth/system/stack/include", |
| 219 | ], |
| 220 | srcs: [ |
Chris Manton | 847dc38 | 2021-05-12 10:08:48 -0700 | [diff] [blame] | 221 | ":TestCommonMainHandler", |
Chris Manton | 47ee7b3 | 2021-04-26 17:12:53 -0700 | [diff] [blame] | 222 | ":TestMockBta", |
| 223 | ":TestMockBtif", |
| 224 | ":TestMockLegacyHciCommands", |
Chris Manton | 3a349d0 | 2021-11-16 19:52:11 -0800 | [diff] [blame] | 225 | ":TestMockLegacyHciInterface", |
Chris Manton | 47ee7b3 | 2021-04-26 17:12:53 -0700 | [diff] [blame] | 226 | ":TestMockMainShimEntry", |
| 227 | ":TestMockStack", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 228 | "shim/acl_api.cc", |
| 229 | "shim/acl.cc", |
| 230 | "shim/acl_legacy_interface.cc", |
| 231 | "shim/btm_api.cc", |
| 232 | "shim/btm.cc", |
| 233 | "shim/config.cc", |
| 234 | "shim/controller.cc", |
| 235 | "shim/dumpsys.cc", |
| 236 | "shim/hci_layer.cc", |
| 237 | "shim/l2c_api.cc", |
| 238 | "shim/le_advertising_manager.cc", |
| 239 | "shim/le_scanning_manager.cc", |
| 240 | "shim/link_policy.cc", |
Chen Chen | 534bf24 | 2021-03-10 15:41:42 -0800 | [diff] [blame] | 241 | "shim/metric_id_api.cc", |
| 242 | "shim/metrics_api.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 243 | "shim/shim.cc", |
| 244 | "shim/stack.cc", |
Chris Manton | ca01f58 | 2022-01-07 13:00:31 -0800 | [diff] [blame] | 245 | "test/common_stack_test.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 246 | "test/main_shim_test.cc", |
| 247 | ], |
| 248 | static_libs: [ |
Chris Manton | e0e56d8 | 2021-10-21 08:09:51 -0700 | [diff] [blame] | 249 | "libbluetooth-dumpsys", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 250 | "libbt-common", |
| 251 | "libbt-protos-lite", |
| 252 | "libgmock", |
| 253 | "liblog", |
| 254 | "libosi", |
| 255 | "libbtdevice", |
| 256 | ], |
| 257 | shared_libs: [ |
| 258 | "libcrypto", |
| 259 | "libflatbuffers-cpp", |
| 260 | "libprotobuf-cpp-lite", |
| 261 | ], |
| 262 | sanitize: { |
| 263 | address: true, |
| 264 | all_undefined: true, |
| 265 | cfi: true, |
| 266 | integer_overflow: true, |
| 267 | scs: true, |
| 268 | diag: { |
| 269 | undefined : true |
| 270 | }, |
| 271 | }, |
| 272 | generated_headers: [ |
| 273 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
| 274 | "BluetoothGeneratedDumpsysDataSchema_h", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 275 | "BluetoothGeneratedPackets_h", |
| 276 | ], |
| 277 | } |