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", |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 24 | defaults: ["fluoride_defaults"], |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 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", |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 45 | "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 Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 52 | shared_libs: [ |
| 53 | "libflatbuffers-cpp", |
| 54 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 55 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 56 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 57 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 58 | "BluetoothGeneratedPackets_h", |
| 59 | ], |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 60 | header_libs: ["libbt_callbacks_cxx_headers"], |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 61 | host_supported: true, |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame^] | 62 | min_sdk_version: "Tiramisu" |
Chris Manton | 878cadc | 2020-01-07 14:05:36 -0800 | [diff] [blame] | 63 | } |
| 64 | |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 65 | cc_library_shared { |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 66 | name: "libbluetooth", |
Etienne Ruffieux | 917abc3 | 2022-02-28 14:07:17 +0000 | [diff] [blame] | 67 | visibility: [ |
| 68 | "//cts/hostsidetests:__subpackages__", |
| 69 | "//packages/modules/Bluetooth:__subpackages__", |
| 70 | "//vendor:__subpackages__", |
| 71 | ], |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 72 | defaults: ["fluoride_defaults"], |
Jakub Pawlowski | a75a654 | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 73 | header_libs: ["libbluetooth_headers"], |
| 74 | export_header_lib_headers: ["libbluetooth_headers"], |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 75 | 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 Pawlowski | 9e9eb4b | 2017-10-17 16:40:41 -0700 | [diff] [blame] | 80 | "packages/modules/Bluetooth/system/internal_include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 81 | "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 He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 89 | "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 He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 92 | "packages/modules/Bluetooth/system/utils/include", |
Martin Brabham | f1e5738 | 2019-02-01 13:42:58 -0800 | [diff] [blame] | 93 | "system/security/keystore/include", |
| 94 | "hardware/interfaces/keymaster/4.0/support/include", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 95 | ], |
| 96 | logtags: ["../../EventLogTags.logtags"], |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 97 | 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 He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 154 | // 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 Tyszkowski | fa3e4cb | 2022-01-25 15:52:01 +0000 | [diff] [blame] | 163 | "audio_set_scenarios_bfbs", |
| 164 | "audio_set_scenarios_json", |
| 165 | "audio_set_configurations_bfbs", |
| 166 | "audio_set_configurations_json", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 167 | ], |
| 168 | cflags: [ |
| 169 | "-DBUILDCFG", |
| 170 | ], |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 171 | sanitize: { |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 172 | never: true, |
Peter Collingbourne | fc97afd | 2018-12-06 17:04:43 -0800 | [diff] [blame] | 173 | }, |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 174 | apex_available: [ |
| 175 | "//apex_available:platform", |
| 176 | "com.android.bluetooth", |
| 177 | ], |
Hansong Zhang | 0769e70 | 2021-03-01 17:52:04 -0800 | [diff] [blame] | 178 | host_supported: true, |
Roopa Sattiraju | 29b3733 | 2021-12-23 12:32:03 -0800 | [diff] [blame] | 179 | min_sdk_version: "30", |
Jack He | 65b2a57 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 180 | } |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 181 | |
| 182 | cc_library_static { |
| 183 | name: "libbluetooth-for-tests", |
| 184 | defaults: ["fluoride_defaults"], |
| 185 | |
| 186 | srcs: [ |
Chris Manton | 28c4c58 | 2019-09-09 21:11:59 -0700 | [diff] [blame] | 187 | ":LibBluetoothSources", |
Chris Manton | 011f6a7 | 2019-12-15 13:20:13 -0800 | [diff] [blame] | 188 | ":LibBluetoothShimSources", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 189 | ], |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 190 | host_supported: true, |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 191 | include_dirs: [ |
| 192 | "packages/modules/Bluetooth/system", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 193 | "packages/modules/Bluetooth/system/gd", |
Zach Johnson | d020415 | 2020-12-02 13:45:19 -0800 | [diff] [blame] | 194 | "packages/modules/Bluetooth/system/gd/rust/shim", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 195 | "packages/modules/Bluetooth/system/bta/include", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 196 | "packages/modules/Bluetooth/system/btif/include", |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 197 | "packages/modules/Bluetooth/system/internal_include", |
| 198 | "packages/modules/Bluetooth/system/stack/include", |
| 199 | "packages/modules/Bluetooth/system/utils/include", |
| 200 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 201 | generated_headers: [ |
Chris Manton | 2e14309 | 2020-07-22 12:42:20 -0700 | [diff] [blame] | 202 | "BluetoothGeneratedBundlerSchema_h_bfbs", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 203 | "BluetoothGeneratedPackets_h", |
Chris Manton | ed1c08b | 2020-06-26 22:17:14 -0700 | [diff] [blame] | 204 | "BluetoothGeneratedDumpsysDataSchema_h", |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 205 | ], |
Pavlin Radoslavov | 96e9e34 | 2017-11-02 14:27:09 -0700 | [diff] [blame] | 206 | cflags: [ |
| 207 | "-DBUILDCFG", |
| 208 | ], |
Chris Manton | 615296f | 2020-06-16 08:58:34 -0700 | [diff] [blame] | 209 | shared_libs: [ |
| 210 | "libflatbuffers-cpp", |
| 211 | ], |
Jakub Pawlowski | d4e4705 | 2020-02-16 01:03:04 +0100 | [diff] [blame] | 212 | whole_static_libs: [ |
| 213 | "libbluetooth_gd", // Gabeldorsche |
Chris Manton | 3ee967b | 2019-11-05 11:39:07 -0800 | [diff] [blame] | 214 | ], |
| 215 | } |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 216 | |
| 217 | cc_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 Manton | 847dc38 | 2021-05-12 10:08:48 -0700 | [diff] [blame] | 231 | ":TestCommonMainHandler", |
Chris Manton | ec5dedb | 2022-01-30 16:58:59 -0800 | [diff] [blame] | 232 | ":TestCommonMockFunctions", |
Chris Manton | 47ee7b3 | 2021-04-26 17:12:53 -0700 | [diff] [blame] | 233 | ":TestMockBta", |
| 234 | ":TestMockBtif", |
| 235 | ":TestMockLegacyHciCommands", |
Chris Manton | 3a349d0 | 2021-11-16 19:52:11 -0800 | [diff] [blame] | 236 | ":TestMockLegacyHciInterface", |
Chris Manton | 47ee7b3 | 2021-04-26 17:12:53 -0700 | [diff] [blame] | 237 | ":TestMockMainShimEntry", |
| 238 | ":TestMockStack", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 239 | "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 Chen | 534bf24 | 2021-03-10 15:41:42 -0800 | [diff] [blame] | 252 | "shim/metric_id_api.cc", |
| 253 | "shim/metrics_api.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 254 | "shim/shim.cc", |
| 255 | "shim/stack.cc", |
Chris Manton | ca01f58 | 2022-01-07 13:00:31 -0800 | [diff] [blame] | 256 | "test/common_stack_test.cc", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 257 | "test/main_shim_test.cc", |
| 258 | ], |
| 259 | static_libs: [ |
Chris Manton | e0e56d8 | 2021-10-21 08:09:51 -0700 | [diff] [blame] | 260 | "libbluetooth-dumpsys", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 261 | "libbt-common", |
| 262 | "libbt-protos-lite", |
| 263 | "libgmock", |
| 264 | "liblog", |
| 265 | "libosi", |
| 266 | "libbtdevice", |
| 267 | ], |
| 268 | shared_libs: [ |
| 269 | "libcrypto", |
Richard Gaywood | e634b3d | 2022-03-10 10:55:06 +0000 | [diff] [blame] | 270 | "libflatbuffers-cpp", |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 271 | "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 Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 286 | "BluetoothGeneratedPackets_h", |
| 287 | ], |
ahujapalash | 5add3d5 | 2022-03-10 18:38:02 +0000 | [diff] [blame^] | 288 | min_sdk_version: "Tiramisu" |
Chris Manton | e6a57a2 | 2021-03-05 12:25:19 -0800 | [diff] [blame] | 289 | } |