blob: 62db3e94a266f5838acf699db55642537c84056e [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
19filegroup {
20 name: "services.bluetooth-sources",
21 srcs: [
Stephanie Bak37db66c2022-10-24 01:50:48 +000022 ":statslog-bluetooth-java-gen",
William Escanded9e14192023-04-21 17:26:52 -070023 "src/**/*.java",
William Escandeee0bafd2023-06-10 20:40:17 -070024 "src/AdapterState.kt",
William Escandef0cb7322024-02-01 17:16:16 -080025 "src/AutoOnFeature.kt",
William Escande9fce26d2023-11-20 17:24:05 -080026 "src/Log.kt",
William Escandec7865172023-07-06 15:10:01 -070027 "src/RadioModeListener.kt",
William Escande75cd7e42023-11-04 23:30:12 -070028 "src/airplane/ModeListener.kt",
William Escandec7865172023-07-06 15:10:01 -070029 "src/com/**/*.kt",
William Escande48ef6e02023-06-07 11:38:24 -070030 "src/satellite/ModeListener.kt",
Roopa Sattiraju816d1422022-01-17 08:20:16 -080031 ],
William Escande675308a2023-06-09 00:52:53 -070032 visibility: [":__subpackages__"],
Roopa Sattiraju816d1422022-01-17 08:20:16 -080033}
Roopa Sattirajuc7938372022-01-20 10:00:42 -080034
William Escande675308a2023-06-09 00:52:53 -070035// pre-jarjar version of service-bluetooth that builds against pre-jarjar version of framework-bluetooth
Roopa Sattirajua25b2352022-01-31 22:48:42 -080036java_defaults {
William Escande675308a2023-06-09 00:52:53 -070037 name: "service-bluetooth-pre-jarjar",
William Escandefa012c42023-12-13 10:20:10 +010038 srcs: [":services.bluetooth-sources"],
William Escande675308a2023-06-09 00:52:53 -070039
Roopa Sattirajua25b2352022-01-31 22:48:42 -080040 errorprone: {
William Escande74ee6e02023-06-01 16:37:40 -070041 javacflags: [
William Escande97359c02023-06-02 15:09:45 -070042 "-Xep:AlreadyChecked:ERROR",
William Escande74ee6e02023-06-01 16:37:40 -070043 "-Xep:CheckReturnValue:ERROR",
William Escandeec058652023-06-01 16:46:08 -070044 "-Xep:ClassCanBeStatic:ERROR",
William Escande74ee6e02023-06-01 16:37:40 -070045 "-Xep:EqualsIncompatibleType:ERROR",
46 "-Xep:ReferenceEquality:ERROR",
47 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080048 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -080049
50 sdk_version: "system_server_current",
51
52 lint: {
William Escanded6cbbd32023-07-10 16:00:07 -070053 error_checks: [
54 "ExtraText",
William Escanded6cbbd32023-07-10 16:00:07 -070055 "NewApi",
56 "ObsoleteSdkInt",
57 "Recycle",
58 "RtlHardcoded",
59 "UseSparseArrays",
60 "UseValueOf",
61 ],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080062 strict_updatability_linting: true,
63 },
William Escanded6cbbd32023-07-10 16:00:07 -070064
65 kotlincflags: [
66 "-Werror",
67 ],
68
Roopa Sattirajua25b2352022-01-31 22:48:42 -080069 libs: [
70 "framework-annotations-lib",
71 "framework-bluetooth-pre-jarjar",
Hassan Ali1daf2dd2022-11-17 16:16:35 +000072 "framework-configinfrastructure",
Stephanie Bak37db66c2022-10-24 01:50:48 +000073 "framework-statsd.stubs.module_lib",
William Escanded2a8cbc2023-04-24 17:07:55 -070074 "service-bluetooth.change-ids",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080075 ],
76
77 static_libs: [
78 "androidx.annotation_annotation",
Etienne Ruffieux3f46b3b2022-02-07 23:14:46 +000079 "androidx.appcompat_appcompat",
Vinh Tran0d62f882022-06-16 11:45:23 -040080 "bluetooth-manager-service-proto-java-gen",
Stephanie Bakf61c87c2022-08-10 04:42:45 +000081 "bluetooth-nano-protos",
William Escande35255402023-04-07 05:46:23 -070082 "bluetooth-proto-enums-java-gen",
William Escande5b551e92023-06-30 18:12:42 -070083 "bluetooth_flags_java_lib",
William Escandec26a8152024-02-05 15:37:55 -080084 "modules-utils-build_system",
William Escande35255402023-04-07 05:46:23 -070085 "modules-utils-shell-command-handler",
Oliver Scott11e8c262020-10-02 13:40:28 -040086 "modules-utils-handlerexecutor",
Roopa Sattirajua25b2352022-01-31 22:48:42 -080087 ],
William Escande675308a2023-06-09 00:52:53 -070088
89 visibility: [":__subpackages__"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080090}
91
92// service-bluetooth static library
93// ==============================================================
94java_library {
95 name: "service-bluetooth",
William Escande675308a2023-06-09 00:52:53 -070096 defaults: ["service-bluetooth-pre-jarjar"],
Roopa Sattirajua25b2352022-01-31 22:48:42 -080097 installable: true,
Roopa Sattirajua25b2352022-01-31 22:48:42 -080098
Roopa Sattiraju2806fbd2022-02-14 14:01:40 -080099 jarjar_rules: ":bluetooth-jarjar-rules",
100
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800101 optimize: {
102 enabled: true,
103 shrink: true,
104 proguard_flags_files: ["proguard.flags"],
105 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800106 visibility: [
107 "//packages/modules/Bluetooth/apex",
108 ],
William Escande675308a2023-06-09 00:52:53 -0700109 apex_available: [
110 "com.android.btservices",
111 ],
112 min_sdk_version: "Tiramisu",
Cole Fauste5504022023-12-20 11:57:06 -0800113 lint: {
114 baseline_filename: "lint-baseline.xml",
115 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800116}
117
Vinh Tran0d62f882022-06-16 11:45:23 -0400118java_library {
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800119 name: "bluetooth-manager-service-proto-java-gen",
Vinh Tran0d62f882022-06-16 11:45:23 -0400120 installable: false,
121 proto: {
122 type: "stream",
123 include_dirs: [
David Duarte6e204df2023-03-19 21:02:51 +0000124 "external/protobuf/src",
Vinh Tran0d62f882022-06-16 11:45:23 -0400125 ],
126 },
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800127 srcs: [
128 ":srcs_bluetooth_manager_service_proto",
129 ],
Vinh Tran0d62f882022-06-16 11:45:23 -0400130 sdk_version: "system_server_current",
131 apex_available: [
William Escande64949f02022-08-22 11:27:59 -0700132 "com.android.btservices",
Vinh Tran0d62f882022-06-16 11:45:23 -0400133 ],
David Duarte6e204df2023-03-19 21:02:51 +0000134 min_sdk_version: "Tiramisu",
Roopa Sattirajua25b2352022-01-31 22:48:42 -0800135}
Etienne Ruffieuxcea8f232022-07-06 23:07:34 -0700136
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000137java_library {
138 name: "bluetooth-nano-protos",
William Escande675308a2023-06-09 00:52:53 -0700139 installable: false,
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000140 proto: {
141 type: "nano",
142 },
143 srcs: [
144 ":system-messages-proto-src",
145 ],
146 libs: ["libprotobuf-java-nano"],
David Duarte6e204df2023-03-19 21:02:51 +0000147 lint: {
148 strict_updatability_linting: true,
Cole Faust15d5a6d2024-01-10 12:30:41 -0800149
David Duarte6e204df2023-03-19 21:02:51 +0000150 },
William Escande675308a2023-06-09 00:52:53 -0700151 sdk_version: "system_current",
152 apex_available: [
153 "com.android.btservices",
154 ],
155 min_sdk_version: "Tiramisu",
Stephanie Bakf61c87c2022-08-10 04:42:45 +0000156}
William Escandec7865172023-07-06 15:10:01 -0700157
158android_robolectric_test {
159 name: "ServiceBluetoothRoboTests",
160 instrumentation_for: "ServiceBluetoothFakeTestApp",
161
162 srcs: [
William Escande75cd7e42023-11-04 23:30:12 -0700163 ":statslog-bluetooth-java-gen",
William Escandeee0bafd2023-06-10 20:40:17 -0700164 "src/AdapterState.kt",
165 "src/AdapterStateTest.kt",
William Escandef0cb7322024-02-01 17:16:16 -0800166 "src/AutoOnFeature.kt",
167 "src/AutoOnFeatureTest.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
178 static_libs: [
179 "androidx.test.core",
William Escande2912f2d2024-02-05 15:37:03 -0800180 "kotlin-test",
William Escandeee0bafd2023-06-10 20:40:17 -0700181 "kotlinx_coroutines",
182 "kotlinx_coroutines_test",
William Escandec7865172023-07-06 15:10:01 -0700183 "mockito-robolectric-prebuilt",
184 "platform-test-annotations",
185 "testng",
Krzysztof KosiƄski371452f2023-10-07 00:48:16 +0000186 "truth",
William Escandec7865172023-07-06 15:10:01 -0700187 ],
188
189 upstream: true,
190 test_suites: ["general-tests"],
191}