blob: 8f018c004fb83e6f3a6ad9dcd32d01b0c6ad7efa [file] [log] [blame]
Aaron Huangf73ff8c2019-12-06 18:12:24 +08001// Copyright (C) 2019 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
Aaron Huang57a94962020-01-03 20:35:55 +080015// 1. The "net-utils-framework-common" library is also compiled into the framework and placed on the
16// boot classpath. It uses jarjar rules so that anything outside the framework can use this
17// library directly.
18// 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services.
19// It does not need to be jarjared because it is not placed on the bootclasspath.
Lorenzo Colittie14bd342020-01-14 14:47:16 +090020// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which
21// places many of its classes, even non-API service classes, on the boot classpath. Any file that
22// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar
23// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able
24// to provide their own copy.
Aaron Huangf73ff8c2019-12-06 18:12:24 +080025
Adrian Roos0607dd92020-03-27 00:30:41 +010026// Note: all filegroups here must have the right path attribute because otherwise, if they are
27// included in the bootclasspath, they could incorrectly be included in the SDK documentation even
28// though they are not in the current.txt files.
29
Bob Badour1b8c7442021-02-12 15:39:10 -080030package {
31 default_applicable_licenses: ["Android-Apache-2.0"],
32}
33
Chalard Jean48c6c7d2020-06-25 23:39:15 +090034java_library {
35 name: "net-utils-device-common",
36 srcs: [
Yuyang Huang6acc55e2023-08-22 13:45:18 +090037 "device/com/android/net/module/util/arp/ArpPacket.java",
Xiao Ma57b34422021-07-01 13:57:02 +000038 "device/com/android/net/module/util/DeviceConfigUtils.java",
fqjc86cece4012023-06-08 19:46:45 +080039 "device/com/android/net/module/util/DomainUtils.java",
Xiao Ma57b34422021-07-01 13:57:02 +000040 "device/com/android/net/module/util/FdEventsReader.java",
Xiao Ma1453c7c2022-07-15 12:08:48 +090041 "device/com/android/net/module/util/NetworkMonitorUtils.java",
Xiao Ma57b34422021-07-01 13:57:02 +000042 "device/com/android/net/module/util/PacketReader.java",
Chalard Jeanb61091b2021-10-07 15:29:13 +090043 "device/com/android/net/module/util/SharedLog.java",
chiachangwangf618ab02022-12-16 07:26:33 +000044 "device/com/android/net/module/util/SocketUtils.java",
chiachangwang16377302023-07-31 14:06:28 +000045 "device/com/android/net/module/util/FeatureVersions.java",
Junyu Lai2ff42d22023-12-07 16:57:13 +080046 "device/com/android/net/module/util/HandlerUtils.java",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090047 // This library is used by system modules, for which the system health impact of Kotlin
Chalard Jean7592a342021-04-19 18:04:34 +090048 // has not yet been evaluated. Annotations may need jarjar'ing.
Chalard Jean48c6c7d2020-06-25 23:39:15 +090049 // "src_devicecommon/**/*.kt",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090050 ],
Chalard Jeand5802422021-10-27 19:02:14 +090051 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +000052 min_sdk_version: "30",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090053 target_sdk_version: "30",
54 apex_available: [
55 "//apex_available:anyapex",
56 "//apex_available:platform",
57 ],
58 visibility: [
59 "//frameworks/base/packages/Tethering",
Baligh Uddinf8c12822021-05-21 04:26:52 +000060 "//packages/modules/Connectivity:__subpackages__",
61 "//packages/modules/Connectivity/framework:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090062 "//frameworks/opt/net/ike",
63 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +000064 "//packages/modules/Wifi/service",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090065 "//frameworks/opt/net/telephony",
Xiao Ma6f95cef2020-09-08 19:16:15 +090066 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090067 "//packages/modules/CaptivePortalLogin",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090068 ],
Xiao Ma5c174542021-02-28 13:09:23 +000069 static_libs: [
70 "net-utils-framework-common",
71 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +090072 libs: [
73 "androidx.annotation_annotation",
Chalard Jeand5802422021-10-27 19:02:14 +090074 "framework-annotations-lib",
Hassan Ali47d424e2022-11-17 16:34:31 +000075 "framework-configinfrastructure",
Xiao Ma1453c7c2022-07-15 12:08:48 +090076 "framework-connectivity.stubs.module_lib",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090077 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +090078 lint: {
79 strict_updatability_linting: true,
80 error_checks: ["NewApi"],
81 },
Chalard Jean48c6c7d2020-06-25 23:39:15 +090082}
83
Chalard Jean48c6c7d2020-06-25 23:39:15 +090084java_defaults {
85 name: "lib_mockito_extended",
86 static_libs: [
87 "mockito-target-extended-minus-junit4"
88 ],
89 jni_libs: [
90 "libdexmakerjvmtiagent",
91 "libstaticjvmtiagent",
92 ],
93}
94
Aswin Sankar601d6f92021-10-11 13:12:16 -070095java_library {
96 name: "net-utils-dnspacket-common",
97 srcs: [
98 "framework/**/DnsPacket.java",
99 "framework/**/DnsPacketUtils.java",
Mike Yu8404b3c2023-09-18 08:27:51 +0000100 "framework/**/DnsSvcbPacket.java",
Mike Yu9b96c832023-09-18 08:26:08 +0000101 "framework/**/DnsSvcbRecord.java",
102 "framework/**/HexDump.java",
103 "framework/**/NetworkStackConstants.java",
Aswin Sankar601d6f92021-10-11 13:12:16 -0700104 ],
105 sdk_version: "module_current",
106 visibility: [
107 "//packages/services/Iwlan:__subpackages__",
108 ],
Junyu Lai85e24e82022-09-15 07:34:51 +0000109 libs: [
Mike Yu9b96c832023-09-18 08:26:08 +0000110 "androidx.annotation_annotation",
Junyu Lai85e24e82022-09-15 07:34:51 +0000111 "framework-annotations-lib",
112 "framework-connectivity.stubs.module_lib",
113 ],
Aswin Sankar601d6f92021-10-11 13:12:16 -0700114}
115
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800116filegroup {
117 name: "net-utils-framework-common-srcs",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900118 srcs: ["framework/**/*.java"],
119 path: "framework",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900120 visibility: [
121 "//frameworks/base",
Baligh Uddin27e5fcd2021-05-22 13:16:30 +0000122 "//packages/modules/Connectivity:__subpackages__",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900123 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800124}
125
126java_library {
markchienf3448f92021-11-10 01:06:51 +0800127 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000128 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800129 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800130 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700131 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800132 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800133 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800134 "device/com/android/net/module/util/JniUtil.java",
markchienbe960362022-01-22 15:10:26 +0800135 "device/com/android/net/module/util/Struct.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100136 "device/com/android/net/module/util/TcUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900137 "framework/com/android/net/module/util/HexDump.java",
markchienf3448f92021-11-10 01:06:51 +0800138 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900139 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000140 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800141 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800142 "//packages/modules/Connectivity:__subpackages__",
143 "//packages/modules/NetworkStack:__subpackages__",
144 ],
markchienf3448f92021-11-10 01:06:51 +0800145 libs: [
146 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900147 "framework-connectivity.stubs.module_lib",
markchienf3448f92021-11-10 01:06:51 +0800148 ],
149 apex_available: [
150 "com.android.tethering",
151 "//apex_available:platform",
152 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900153 lint: {
154 strict_updatability_linting: true,
155 error_checks: ["NewApi"],
156 },
markchienf3448f92021-11-10 01:06:51 +0800157}
158
159java_library {
160 name: "net-utils-device-common-struct",
161 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000162 "device/com/android/net/module/util/Ipv6Utils.java",
Hungming Chen435833f2021-09-14 20:26:27 +0800163 "device/com/android/net/module/util/PacketBuilder.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000164 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000165 "device/com/android/net/module/util/structs/*.java",
166 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900167 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000168 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000169 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000170 "//packages/modules/Connectivity:__subpackages__",
171 "//packages/modules/NetworkStack:__subpackages__",
172 ],
173 static_libs: [
174 "net-utils-framework-common",
175 ],
176 libs: [
177 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900178 "framework-connectivity.stubs.module_lib",
Xiao Ma57b34422021-07-01 13:57:02 +0000179 ],
180 apex_available: [
181 "com.android.tethering",
182 "//apex_available:platform",
183 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900184 lint: {
185 strict_updatability_linting: true,
186 error_checks: ["NewApi"],
187 },
Xiao Ma57b34422021-07-01 13:57:02 +0000188}
189
Junyu Lai626045a2023-08-28 18:49:44 +0800190// The net-utils-device-common-netlink library requires the callers to contain
191// net-utils-device-common-struct.
Xiao Ma57b34422021-07-01 13:57:02 +0000192java_library {
markchienf3448f92021-11-10 01:06:51 +0800193 name: "net-utils-device-common-netlink",
194 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000195 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800196 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900197 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000198 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800199 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800200 "//packages/modules/Connectivity:__subpackages__",
201 "//packages/modules/NetworkStack:__subpackages__",
202 ],
markchienf3448f92021-11-10 01:06:51 +0800203 libs: [
204 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900205 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800206 // For libraries which are statically linked in framework-connectivity, do not
207 // statically link here because callers of this library might already have a static
208 // version linked.
209 "net-utils-device-common-struct",
markchienf3448f92021-11-10 01:06:51 +0800210 ],
211 apex_available: [
212 "com.android.tethering",
213 "//apex_available:platform",
214 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900215 lint: {
216 strict_updatability_linting: true,
217 error_checks: ["NewApi"],
218 },
markchienf3448f92021-11-10 01:06:51 +0800219}
220
Junyu Lai626045a2023-08-28 18:49:44 +0800221// The net-utils-device-common-ip library requires the callers to contain
222// net-utils-device-common-struct.
markchienf3448f92021-11-10 01:06:51 +0800223java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900224 // TODO : this target should probably be folded into net-utils-device-common
225 name: "net-utils-device-common-ip",
226 srcs: [
227 "device/com/android/net/module/util/ip/*.java",
228 ],
229 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000230 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900231 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900232 "//packages/modules/Connectivity:__subpackages__",
233 "//packages/modules/NetworkStack:__subpackages__",
234 ],
235 libs: [
236 "framework-annotations-lib",
237 "framework-connectivity",
238 ],
239 static_libs: [
240 "net-utils-device-common",
241 "net-utils-device-common-netlink",
242 "net-utils-framework-common",
243 "netd-client",
244 ],
245 apex_available: [
246 "com.android.tethering",
247 "//apex_available:platform",
248 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900249 lint: {
250 strict_updatability_linting: true,
251 error_checks: ["NewApi"],
252 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900253}
254
255java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800256 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900257 srcs: [
258 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900259 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900260 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000261 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900262 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900263 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900264 "framework-annotations-lib",
265 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800266 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000267 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900268 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800269 jarjar_rules: "jarjar-rules-shared.txt",
270 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800271 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900272 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000273 "//packages/modules/Connectivity/tests/cts/net",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800274 "//frameworks/base/packages/Tethering",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000275 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900276 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800277 "//frameworks/opt/net/ike",
278 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900279 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900280 "//frameworks/base/packages/Connectivity:__subpackages__",
281 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900282 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800283 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000284 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000285 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900286 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900287 lint: {
288 strict_updatability_linting: true,
289 error_checks: ["NewApi"],
290 },
Paul Hu8d47d842023-03-31 14:59:49 +0800291 errorprone: {
292 enabled: true,
293 // Error-prone checking only warns of problems when building. To make the build fail with
294 // these errors, list the specific error-prone problems below.
295 javacflags: [
296 "-Xep:NullablePrimitive:ERROR",
297 ],
298 },
Spandan Das2b83e772023-12-21 20:46:31 +0000299 apex_available: [
300 "//apex_available:platform",
301 "com.android.tethering",
302 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800303}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000304
305java_library {
306 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700307 srcs: [
308 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900309 "device/android/net/NetworkFactoryImpl.java",
310 "device/android/net/NetworkFactoryLegacyImpl.java",
311 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700312 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900313 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000314 min_sdk_version: "30",
Chalard Jean7592a342021-04-19 18:04:34 +0900315 static_libs: [
316 "modules-utils-build_system",
317 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900318 libs: [
319 "framework-annotations-lib",
320 "framework-connectivity",
321 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000322 // TODO: remove "apex_available:platform".
323 apex_available: [
324 "//apex_available:platform",
William Escandefbe576b2022-08-22 11:28:00 -0700325 "com.android.btservices",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000326 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000327 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000328 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800329 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800330 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900331 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000332 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900333 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800334 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000335 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800336 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900337 lint: {
338 strict_updatability_linting: true,
339 error_checks: ["NewApi"],
340 },
Aaron Huang57a94962020-01-03 20:35:55 +0800341}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900342
Igor Chernysheva25f1092022-12-20 00:07:38 -0800343java_library {
344 name: "net-utils-device-common-async",
345 srcs: [
346 "device/com/android/net/module/util/async/*.java",
347 ],
348 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000349 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800350 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800351 "//packages/modules/Connectivity:__subpackages__",
352 ],
353 libs: [
354 "framework-annotations-lib",
355 ],
356 static_libs: [
357 ],
358 apex_available: [
359 "com.android.tethering",
360 "//apex_available:platform",
361 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900362 lint: {
363 strict_updatability_linting: true,
364 error_checks: ["NewApi"],
365 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800366}
367
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700368java_library {
369 name: "net-utils-device-common-wear",
370 srcs: [
371 "device/com/android/net/module/util/wear/*.java",
372 ],
373 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000374 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700375 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700376 "//packages/modules/Connectivity:__subpackages__",
377 ],
378 libs: [
379 "framework-annotations-lib",
380 ],
381 static_libs: [
382 "net-utils-device-common-async",
383 ],
384 apex_available: [
385 "com.android.tethering",
386 "//apex_available:platform",
387 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900388 lint: {
389 strict_updatability_linting: true,
390 error_checks: ["NewApi"],
391 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700392}
393
Yuyang Huangf67388b2023-03-29 16:51:09 +0900394// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
395// the mDNS code can build with only system APIs.
396// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
397// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
398// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
399// the annotations.
400// When using "system_current", framework annotations are not available; they would appear as
401// package-private as they are marked as such in the system_current stubs. So build against
402// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
403java_library {
404 name: "net-utils-device-common-mdns-standalone-build-test",
405 // Build against core_platform and add the stub libraries manually in "libs", as annotations
406 // are already included in android_system_stubs_current but package-private, so
407 // "framework-annotations-lib" needs to be manually included before
408 // "android_system_stubs_current" (b/272392042)
409 sdk_version: "core_platform",
410 srcs: [
411 "device/com/android/net/module/util/FdEventsReader.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900412 "device/com/android/net/module/util/SharedLog.java",
413 "framework/com/android/net/module/util/ByteUtils.java",
414 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900415 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900416 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
417 ],
418 libs: [
419 "framework-annotations-lib",
420 "android_system_stubs_current",
421 "androidx.annotation_annotation",
422 ],
423 visibility: ["//packages/modules/Connectivity/service-t"],
424}
425
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900426// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
427// included either (some annotations would be duplicated on the bootclasspath).
428filegroup {
429 name: "net-utils-telephony-common-srcs",
430 srcs: [
431 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900432 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900433 "device/android/net/NetworkFactoryImpl.java",
434 "device/android/net/NetworkFactoryLegacyImpl.java",
435 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900436 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900437 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900438 visibility: [
439 "//frameworks/opt/telephony",
440 ],
441}
Roshan Pius864bdec2020-01-16 09:19:11 -0800442
443// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
444// rules on the wifi side.
445// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
446filegroup {
447 name: "net-utils-framework-wifi-common-srcs",
448 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900449 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
450 "framework/com/android/net/module/util/Inet4AddressUtils.java",
451 "framework/com/android/net/module/util/InetAddressUtils.java",
452 "framework/com/android/net/module/util/MacAddressUtils.java",
453 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800454 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900455 path: "framework",
Roshan Pius864bdec2020-01-16 09:19:11 -0800456 visibility: [
457 "//frameworks/base",
458 ],
459}
460
461// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
462// rules on the wifi side.
463// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
464filegroup {
465 name: "net-utils-wifi-service-common-srcs",
466 srcs: [
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900467 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900468 "device/android/net/NetworkFactoryImpl.java",
469 "device/android/net/NetworkFactoryLegacyImpl.java",
470 "device/android/net/NetworkFactoryShim.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800471 ],
472 visibility: [
473 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000474 "//packages/modules/Wifi/service",
Roshan Pius864bdec2020-01-16 09:19:11 -0800475 ],
476}