blob: 3738278ce1eff9e94d341220347735f41c640022 [file] [log] [blame]
Roopa Sattiraju816d1422022-01-17 08:20:16 -08001// Copyright (C) 2021 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Roopa Sattirajua25b2352022-01-31 22:48:42 -080019java_defaults {
William Escande34a25052024-04-10 16:26:43 -070020 name: "service-bluetooth-buildflags",
William Escandec7480a12024-11-12 11:51:59 -080021 defaults: ["bluetooth_framework_errorprone_rules"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080022
Roopa Sattirajua25b2352022-01-31 22:48:42 -080023 lint: {
William Escanded6cbbd32023-07-10 16:00:07 -070024 error_checks: [
25 "ExtraText",
William Escanded6cbbd32023-07-10 16:00:07 -070026 "NewApi",
27 "ObsoleteSdkInt",
28 "Recycle",
29 "RtlHardcoded",
30 "UseSparseArrays",
31 "UseValueOf",
32 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080033 strict_updatability_linting: true,
34 },
William Escanded6cbbd32023-07-10 16:00:07 -070035
36 kotlincflags: [
37 "-Werror",
38 ],
39
William Escande34a25052024-04-10 16:26:43 -070040 defaults_visibility: [":__subpackages__"],
41}
42
43// pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth
44java_library {
45 name: "service-bluetooth-pre-jarjar",
46 defaults: ["service-bluetooth-buildflags"],
47 installable: false,
48 srcs: [
49 ":statslog-bluetooth-java-gen",
50 "src/**/*.java",
William Escande4558feb2024-07-17 19:07:10 -070051 "src/ActiveLog.kt",
William Escandede428982024-04-30 16:13:52 -070052 "src/AdapterBinder.kt",
William Escande34a25052024-04-10 16:26:43 -070053 "src/AdapterState.kt",
54 "src/AutoOnFeature.kt",
William Escande876ebbd2024-05-21 15:20:34 -070055 "src/BleScanSettingListener.kt",
William Escandede428982024-04-30 16:13:52 -070056 "src/BluetoothService.kt",
William Escande34a25052024-04-10 16:26:43 -070057 "src/Log.kt",
58 "src/RadioModeListener.kt",
59 "src/airplane/ModeListener.kt",
William Escande34a25052024-04-10 16:26:43 -070060 "src/satellite/ModeListener.kt",
61 ],
62
Roopa Sattirajua25b2352022-01-31 22:48:42 -080063 libs: [
64 "framework-annotations-lib",
65 "framework-bluetooth-pre-jarjar",
Jihoon Kang1e83ff02024-08-30 00:29:54 +000066 "framework-configinfrastructure.stubs.module_lib",
Stephanie Bak37db66c2022-10-24 01:50:48 +000067 "framework-statsd.stubs.module_lib",
William Escandea7340e72024-04-09 19:45:40 -070068 "service-bluetooth-binder-aidl",
William Escanded2a8cbc2023-04-24 17:07:55 -070069 "service-bluetooth.change-ids",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080070 ],
71
72 static_libs: [
73 "androidx.annotation_annotation",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000074 "androidx.appcompat_appcompat",
Vinh Tran0d62f882022-06-16 11:45:23 -040075 "bluetooth-manager-service-proto-java-gen",
Stephanie Bakf61c87c2022-08-10 04:42:45 +000076 "bluetooth-nano-protos",
William Escande35255402023-04-07 05:46:23 -070077 "bluetooth-proto-enums-java-gen",
William Escande5b551e92023-06-30 18:12:42 -070078 "bluetooth_flags_java_lib",
William Escandec26a8152024-02-05 15:37:55 -080079 "modules-utils-build_system",
William Escande35255402023-04-07 05:46:23 -070080 "modules-utils-shell-command-handler",
Oliver Scott4d92f982024-09-05 21:27:49 -040081 "modules-utils-handlerexecutor",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080082 ],
William Escande675308a2023-06-09 00:52:53 -070083
William Escande34a25052024-04-10 16:26:43 -070084 optimize: {
85 enabled: true,
86 shrink: true,
87 proguard_flags_files: ["proguard.flags"],
88 },
89
90 sdk_version: "system_server_current",
91 min_sdk_version: "Tiramisu",
92 apex_available: ["com.android.btservices"],
William Escande675308a2023-06-09 00:52:53 -070093 visibility: [":__subpackages__"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080094}
95
William Escande34a25052024-04-10 16:26:43 -070096// Apply jarjaring before using library in the apex
Roopa Sattirajua25b2352022-01-31 22:48:42 -080097java_library {
98 name: "service-bluetooth",
William Escande34a25052024-04-10 16:26:43 -070099 static_libs: ["service-bluetooth-pre-jarjar"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800100 installable: true,
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800101
Roopa Sattiraju2806fbd2022-02-14 14:01:40 -0800102 jarjar_rules: ":bluetooth-jarjar-rules",
103
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800104 optimize: {
105 enabled: true,
106 shrink: true,
107 proguard_flags_files: ["proguard.flags"],
108 },
William Escande34a25052024-04-10 16:26:43 -0700109
110 libs: [
Jihoon Kang1e83ff02024-08-30 00:29:54 +0000111 "framework-bluetooth.impl",
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800112 ],
William Escande34a25052024-04-10 16:26:43 -0700113
William Escande1ab924e2024-06-12 10:48:34 -0700114 sdk_version: "system_server_current",
William Escande675308a2023-06-09 00:52:53 -0700115 min_sdk_version: "Tiramisu",
William Escande34a25052024-04-10 16:26:43 -0700116 apex_available: ["com.android.btservices"],
117 visibility: ["//packages/modules/Bluetooth/apex"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800118}
119
Vinh Tran0d62f882022-06-16 11:45:23 -0400120java_library {
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800121 name: "bluetooth-manager-service-proto-java-gen",
William Escande34a25052024-04-10 16:26:43 -0700122 srcs: [":srcs_bluetooth_manager_service_proto"],
Vinh Tran0d62f882022-06-16 11:45:23 -0400123 installable: false,
William Escande34a25052024-04-10 16:26:43 -0700124
Vinh Tran0d62f882022-06-16 11:45:23 -0400125 proto: {
126 type: "stream",
William Escande34a25052024-04-10 16:26:43 -0700127 include_dirs: ["external/protobuf/src"],
Vinh Tran0d62f882022-06-16 11:45:23 -0400128 },
William Escande34a25052024-04-10 16:26:43 -0700129
Vinh Tran0d62f882022-06-16 11:45:23 -0400130 sdk_version: "system_server_current",
David Duarte6e204df2023-03-19 21:02:51 +0000131 min_sdk_version: "Tiramisu",
William Escande34a25052024-04-10 16:26:43 -0700132 apex_available: ["com.android.btservices"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800133}
Etienne Ruffieuxcea8f232022-07-06 23:07:34 -0700134
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000135java_library {
136 name: "bluetooth-nano-protos",
William Escande34a25052024-04-10 16:26:43 -0700137 srcs: [":system-messages-proto-src"],
William Escande675308a2023-06-09 00:52:53 -0700138 installable: false,
William Escande34a25052024-04-10 16:26:43 -0700139
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000140 proto: {
141 type: "nano",
142 },
William Escande34a25052024-04-10 16:26:43 -0700143
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000144 libs: ["libprotobuf-java-nano"],
David Duarte6e204df2023-03-19 21:02:51 +0000145 lint: {
146 strict_updatability_linting: true,
147 },
William Escande34a25052024-04-10 16:26:43 -0700148
William Escande675308a2023-06-09 00:52:53 -0700149 sdk_version: "system_current",
William Escande675308a2023-06-09 00:52:53 -0700150 min_sdk_version: "Tiramisu",
William Escande34a25052024-04-10 16:26:43 -0700151 apex_available: ["com.android.btservices"],
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000152}
William Escandec7865172023-07-06 15:10:01 -0700153
154android_robolectric_test {
155 name: "ServiceBluetoothRoboTests",
156 instrumentation_for: "ServiceBluetoothFakeTestApp",
157
158 srcs: [
William Escande75cd7e42023-11-04 23:30:12 -0700159 ":statslog-bluetooth-java-gen",
William Escande4558feb2024-07-17 19:07:10 -0700160 "src/ActiveLog.kt",
161 "src/ActiveLogTest.kt",
William Escandeee0bafd2023-06-10 20:40:17 -0700162 "src/AdapterState.kt",
163 "src/AdapterStateTest.kt",
William Escandef0cb7322024-02-01 17:16:16 -0800164 "src/AutoOnFeature.kt",
165 "src/AutoOnFeatureTest.kt",
William Escande876ebbd2024-05-21 15:20:34 -0700166 "src/BleScanSettingListener.kt",
167 "src/BleScanSettingListenerTest.kt",
William Escande9fce26d2023-11-20 17:24:05 -0800168 "src/Log.kt",
William Escandee697b022023-11-27 13:46:12 -0800169 "src/LogTest.kt",
William Escandec7865172023-07-06 15:10:01 -0700170 "src/RadioModeListener.kt",
171 "src/RadioModeListenerTest.kt",
William Escande75cd7e42023-11-04 23:30:12 -0700172 "src/airplane/ModeListener.kt",
173 "src/airplane/ModeListenerTest.kt",
William Escande48ef6e02023-06-07 11:38:24 -0700174 "src/satellite/ModeListener.kt",
175 "src/satellite/ModeListenerTest.kt",
William Escandec7865172023-07-06 15:10:01 -0700176 ],
177
William Escande6e13cbd2024-03-18 15:05:23 -0700178 jarjar_rules: ":bluetooth-jarjar-rules",
179
William Escandec7865172023-07-06 15:10:01 -0700180 static_libs: [
181 "androidx.test.core",
William Escande250e3052024-03-14 17:00:25 -0700182 "androidx.test.ext.truth",
William Escande4558feb2024-07-17 19:07:10 -0700183 "bluetooth-manager-service-proto-java-gen",
184 "bluetooth-nano-protos",
185 "bluetooth-proto-enums-java-gen",
William Escande893bd192024-04-30 22:39:04 -0700186 "bluetooth_flags_java_lib",
187 "flag-junit",
William Escande2912f2d2024-02-05 15:37:03 -0800188 "kotlin-test",
William Escandeee0bafd2023-06-10 20:40:17 -0700189 "kotlinx_coroutines",
190 "kotlinx_coroutines_test",
William Escandec7865172023-07-06 15:10:01 -0700191 "mockito-robolectric-prebuilt",
Zhi Dou581ea192024-05-02 14:37:13 +0000192 "modules-utils-expresslog",
William Escandec7865172023-07-06 15:10:01 -0700193 "platform-test-annotations",
William Escandee8f6dec2024-08-27 14:43:11 -0700194 "service-bluetooth-binder-aidl",
William Escandec7865172023-07-06 15:10:01 -0700195 "testng",
Krzysztof KosiƄski371452f2023-10-07 00:48:16 +0000196 "truth",
William Escandec7865172023-07-06 15:10:01 -0700197 ],
198
William Escande32fa7bd2024-05-21 15:10:50 -0700199 libs: [
200 "framework-bluetooth.stubs.module_lib",
201 "framework-statsd.stubs.module_lib",
202 ],
203
William Escande2ec3e722024-06-17 16:10:54 -0700204 sdk_version: "test_current",
William Escandec7865172023-07-06 15:10:01 -0700205 upstream: true,
206 test_suites: ["general-tests"],
Kevin Liua7862b02024-05-03 20:05:21 +0000207 strict_mode: false,
William Escandec7865172023-07-06 15:10:01 -0700208}