blob: 046b0355f959cb39e0189a4c3abdf39491dea312 [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 {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000031 default_team: "trendy_team_fwk_core_networking",
Bob Badour1b8c7442021-02-12 15:39:10 -080032 default_applicable_licenses: ["Android-Apache-2.0"],
33}
34
Paul Hu8c8d2b12024-10-15 15:59:31 +000035// This library shouldn't be used anymore (no class should be added), and per-user libraries like
36// net-utils-service-connectivity or net-utils-framework-wifi should be used instead.
Chalard Jean48c6c7d2020-06-25 23:39:15 +090037java_library {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000038 name: "net-utils-device-common",
39 srcs: [
40 "device/com/android/net/module/util/arp/ArpPacket.java",
41 "device/com/android/net/module/util/DeviceConfigUtils.java",
42 "device/com/android/net/module/util/DomainUtils.java",
43 "device/com/android/net/module/util/FdEventsReader.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070044 "device/com/android/net/module/util/FeatureVersions.java",
45 "device/com/android/net/module/util/HandlerUtils.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000046 "device/com/android/net/module/util/NetworkMonitorUtils.java",
47 "device/com/android/net/module/util/PacketReader.java",
48 "device/com/android/net/module/util/SharedLog.java",
49 "device/com/android/net/module/util/SocketUtils.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070050 "device/com/android/net/module/util/SyncStateMachine.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000051 // This library is used by system modules, for which the system health impact of Kotlin
52 // has not yet been evaluated. Annotations may need jarjar'ing.
53 // "src_devicecommon/**/*.kt",
54 ],
55 sdk_version: "module_current",
56 min_sdk_version: "30",
57 target_sdk_version: "30",
58 apex_available: [
59 "//apex_available:anyapex",
60 "//apex_available:platform",
61 ],
62 visibility: [
Baligh Uddinf8c12822021-05-21 04:26:52 +000063 "//packages/modules/Connectivity:__subpackages__",
64 "//packages/modules/Connectivity/framework:__subpackages__",
Xiao Ma6f95cef2020-09-08 19:16:15 +090065 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090066 "//packages/modules/CaptivePortalLogin",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000067 ],
68 static_libs: [
Patrick Rohraa06b2b2024-06-17 14:18:36 -070069 "modules-utils-statemachine",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000070 "net-utils-framework-common",
71 ],
72 libs: [
73 "androidx.annotation_annotation",
74 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +000075 "framework-configinfrastructure.stubs.module_lib",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000076 "framework-connectivity.stubs.module_lib",
77 ],
78 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: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000087 "mockito-target-extended-minus-junit4",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090088 ],
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: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000098 "framework/**/DnsPacket.java",
99 "framework/**/DnsPacketUtils.java",
100 "framework/**/DnsSvcbPacket.java",
101 "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
Yang Sun3aa62e62024-03-12 21:23:19 +0800126// The net-utils-device-common-bpf library requires the callers to contain
127// net-utils-device-common-struct-base.
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800128java_library {
markchienf3448f92021-11-10 01:06:51 +0800129 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000130 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800131 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800132 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700133 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800134 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800135 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800136 "device/com/android/net/module/util/JniUtil.java",
Lorenzo Colitti05be2f52024-06-02 13:24:21 +0900137 "device/com/android/net/module/util/SingleWriterBpfMap.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100138 "device/com/android/net/module/util/TcUtils.java",
markchienf3448f92021-11-10 01:06:51 +0800139 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900140 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000141 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800142 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800143 "//packages/modules/Connectivity:__subpackages__",
144 "//packages/modules/NetworkStack:__subpackages__",
145 ],
markchienf3448f92021-11-10 01:06:51 +0800146 libs: [
147 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900148 "framework-connectivity.stubs.module_lib",
Yang Sun3aa62e62024-03-12 21:23:19 +0800149 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800150 ],
151 apex_available: [
152 "com.android.tethering",
153 "//apex_available:platform",
154 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900155 lint: {
156 strict_updatability_linting: true,
157 error_checks: ["NewApi"],
158 },
markchienf3448f92021-11-10 01:06:51 +0800159}
160
161java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800162 name: "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800163 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000164 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000165 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900166 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000167 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000168 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000169 "//packages/modules/Connectivity:__subpackages__",
170 "//packages/modules/NetworkStack:__subpackages__",
171 ],
172 static_libs: [
173 "net-utils-framework-common",
174 ],
175 libs: [
176 "androidx.annotation_annotation",
Yang Sun3aa62e62024-03-12 21:23:19 +0800177 "framework-annotations-lib", // Required by InetAddressUtils.java
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
Yang Sun3aa62e62024-03-12 21:23:19 +0800190// The net-utils-device-common-struct library requires the callers to contain
191// net-utils-device-common-struct-base.
Yang Sun1c9fb592024-02-19 10:37:26 +0800192java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800193 name: "net-utils-device-common-struct",
Yang Sun1c9fb592024-02-19 10:37:26 +0800194 srcs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800195 "device/com/android/net/module/util/Ipv6Utils.java",
196 "device/com/android/net/module/util/PacketBuilder.java",
197 "device/com/android/net/module/util/structs/*.java",
Yang Sun1c9fb592024-02-19 10:37:26 +0800198 ],
199 sdk_version: "module_current",
200 min_sdk_version: "30",
201 visibility: [
202 "//packages/modules/Connectivity:__subpackages__",
Yang Sun3aa62e62024-03-12 21:23:19 +0800203 "//packages/modules/NetworkStack:__subpackages__",
Yang Sun1c9fb592024-02-19 10:37:26 +0800204 ],
205 libs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800206 "androidx.annotation_annotation",
207 "framework-annotations-lib", // Required by IpUtils.java
208 "framework-connectivity.stubs.module_lib",
209 "net-utils-device-common-struct-base",
Yang Sun1c9fb592024-02-19 10:37:26 +0800210 ],
211 apex_available: [
212 "com.android.tethering",
Yang Sun3aa62e62024-03-12 21:23:19 +0800213 "//apex_available:platform",
Yang Sun1c9fb592024-02-19 10:37:26 +0800214 ],
215 lint: {
216 strict_updatability_linting: true,
217 error_checks: ["NewApi"],
218 },
219}
220
Junyu Lai626045a2023-08-28 18:49:44 +0800221// The net-utils-device-common-netlink library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800222// net-utils-device-common-struct and net-utils-device-common-struct-base.
Xiao Ma57b34422021-07-01 13:57:02 +0000223java_library {
markchienf3448f92021-11-10 01:06:51 +0800224 name: "net-utils-device-common-netlink",
225 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000226 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800227 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900228 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000229 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800230 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800231 "//packages/modules/Connectivity:__subpackages__",
232 "//packages/modules/NetworkStack:__subpackages__",
233 ],
markchienf3448f92021-11-10 01:06:51 +0800234 libs: [
235 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900236 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800237 // For libraries which are statically linked in framework-connectivity, do not
238 // statically link here because callers of this library might already have a static
239 // version linked.
240 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +0800241 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800242 ],
243 apex_available: [
244 "com.android.tethering",
245 "//apex_available:platform",
246 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900247 lint: {
248 strict_updatability_linting: true,
249 error_checks: ["NewApi"],
250 },
markchienf3448f92021-11-10 01:06:51 +0800251}
252
Junyu Lai626045a2023-08-28 18:49:44 +0800253// The net-utils-device-common-ip library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800254// net-utils-device-common-struct and net-utils-device-common-struct-base.
markchienf3448f92021-11-10 01:06:51 +0800255java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900256 // TODO : this target should probably be folded into net-utils-device-common
257 name: "net-utils-device-common-ip",
258 srcs: [
259 "device/com/android/net/module/util/ip/*.java",
260 ],
261 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000262 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900263 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900264 "//packages/modules/Connectivity:__subpackages__",
265 "//packages/modules/NetworkStack:__subpackages__",
266 ],
267 libs: [
268 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000269 "framework-connectivity.stubs.module_lib",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900270 ],
271 static_libs: [
272 "net-utils-device-common",
273 "net-utils-device-common-netlink",
274 "net-utils-framework-common",
275 "netd-client",
276 ],
277 apex_available: [
278 "com.android.tethering",
279 "//apex_available:platform",
280 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900281 lint: {
Motomu Utsumia1a00342024-06-13 09:29:47 +0000282 strict_updatability_linting: true,
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900283 error_checks: ["NewApi"],
284 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900285}
286
287java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800288 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900289 srcs: [
290 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900291 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900292 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000293 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900294 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900295 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900296 "framework-annotations-lib",
297 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800298 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000299 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900300 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800301 jarjar_rules: "jarjar-rules-shared.txt",
302 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800303 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900304 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000305 "//packages/modules/Connectivity/tests/cts/net",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000306 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900307 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800308 "//frameworks/opt/net/ike",
309 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900310 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900311 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900312 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800313 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000314 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000315 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900316 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900317 lint: {
318 strict_updatability_linting: true,
319 error_checks: ["NewApi"],
320 },
Paul Hu8d47d842023-03-31 14:59:49 +0800321 errorprone: {
322 enabled: true,
323 // Error-prone checking only warns of problems when building. To make the build fail with
324 // these errors, list the specific error-prone problems below.
325 javacflags: [
326 "-Xep:NullablePrimitive:ERROR",
327 ],
328 },
Spandan Das2b83e772023-12-21 20:46:31 +0000329 apex_available: [
330 "//apex_available:platform",
331 "com.android.tethering",
332 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800333}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000334
335java_library {
336 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700337 srcs: [
338 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900339 "device/android/net/NetworkFactoryImpl.java",
340 "device/android/net/NetworkFactoryLegacyImpl.java",
341 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700342 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900343 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000344 min_sdk_version: "30",
Chalard Jeand5802422021-10-27 19:02:14 +0900345 libs: [
346 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000347 "framework-connectivity.stubs.module_lib",
William Escande51c0be52024-07-10 14:26:50 -0700348 "modules-utils-build_system",
Chalard Jeand5802422021-10-27 19:02:14 +0900349 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000350 // TODO: remove "apex_available:platform".
351 apex_available: [
352 "//apex_available:platform",
William Escandefbe576b2022-08-22 11:28:00 -0700353 "com.android.btservices",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000354 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000355 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000356 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800357 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800358 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900359 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000360 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900361 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800362 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000363 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800364 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900365 lint: {
366 strict_updatability_linting: true,
367 error_checks: ["NewApi"],
368 },
Aaron Huang57a94962020-01-03 20:35:55 +0800369}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900370
Igor Chernysheva25f1092022-12-20 00:07:38 -0800371java_library {
372 name: "net-utils-device-common-async",
373 srcs: [
374 "device/com/android/net/module/util/async/*.java",
375 ],
376 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000377 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800378 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800379 "//packages/modules/Connectivity:__subpackages__",
380 ],
381 libs: [
382 "framework-annotations-lib",
383 ],
384 static_libs: [
385 ],
386 apex_available: [
387 "com.android.tethering",
388 "//apex_available:platform",
389 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900390 lint: {
391 strict_updatability_linting: true,
392 error_checks: ["NewApi"],
393 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800394}
395
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700396java_library {
397 name: "net-utils-device-common-wear",
398 srcs: [
399 "device/com/android/net/module/util/wear/*.java",
400 ],
401 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000402 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700403 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700404 "//packages/modules/Connectivity:__subpackages__",
405 ],
406 libs: [
407 "framework-annotations-lib",
408 ],
409 static_libs: [
410 "net-utils-device-common-async",
411 ],
412 apex_available: [
413 "com.android.tethering",
414 "//apex_available:platform",
415 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900416 lint: {
417 strict_updatability_linting: true,
418 error_checks: ["NewApi"],
419 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700420}
421
Yuyang Huangf67388b2023-03-29 16:51:09 +0900422// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
423// the mDNS code can build with only system APIs.
424// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
425// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
426// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
427// the annotations.
428// When using "system_current", framework annotations are not available; they would appear as
429// package-private as they are marked as such in the system_current stubs. So build against
430// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
431java_library {
432 name: "net-utils-device-common-mdns-standalone-build-test",
433 // Build against core_platform and add the stub libraries manually in "libs", as annotations
434 // are already included in android_system_stubs_current but package-private, so
435 // "framework-annotations-lib" needs to be manually included before
436 // "android_system_stubs_current" (b/272392042)
437 sdk_version: "core_platform",
438 srcs: [
439 "device/com/android/net/module/util/FdEventsReader.java",
Paul Hu78713202024-08-01 15:12:10 +0000440 "device/com/android/net/module/util/HandlerUtils.java",
Paul Hu3d51a992024-09-16 16:27:08 +0000441 "device/com/android/net/module/util/JniUtil.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900442 "device/com/android/net/module/util/SharedLog.java",
Paul Hu3d51a992024-09-16 16:27:08 +0000443 "device/com/android/net/module/util/TimerFdUtils.java",
444 "device/com/android/net/module/util/TimerFileDescriptor.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900445 "framework/com/android/net/module/util/ByteUtils.java",
446 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huangd851a042024-07-16 18:48:43 +0900447 "framework/com/android/net/module/util/DnsUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900448 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900449 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
450 ],
451 libs: [
452 "framework-annotations-lib",
453 "android_system_stubs_current",
454 "androidx.annotation_annotation",
455 ],
456 visibility: ["//packages/modules/Connectivity/service-t"],
457}
458
Handa Wang8be10bf2024-08-08 15:36:48 +0000459// net-utils-framework-connectivity is only for framework-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000460java_library {
461 name: "net-utils-framework-connectivity",
462 srcs: [
463 ":net-utils-framework-connectivity-srcs",
464 ],
465 sdk_version: "module_current",
466 min_sdk_version: "30",
467 apex_available: [
468 "com.android.tethering",
469 "//apex_available:platform",
470 ],
471 visibility: [
Handa Wang8be10bf2024-08-08 15:36:48 +0000472 "//packages/modules/Connectivity/framework",
Handa Wang9b0df362024-07-02 13:17:43 +0000473 ],
474 libs: [
475 "androidx.annotation_annotation",
476 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000477 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000478 "framework-connectivity.stubs.module_lib",
479 ],
480 lint: {
481 strict_updatability_linting: true,
482 error_checks: ["NewApi"],
483 },
484}
485
486java_defaults {
487 name: "net-utils-non-bootclasspath-defaults",
488 sdk_version: "module_current",
489 min_sdk_version: "30",
Handa Wang9b0df362024-07-02 13:17:43 +0000490 libs: [
491 "androidx.annotation_annotation",
492 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000493 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000494 "framework-connectivity.stubs.module_lib",
495 "framework-connectivity-t.stubs.module_lib",
496 "framework-location.stubs.module_lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000497 "framework-tethering.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000498 "unsupportedappusage",
499 ],
500 static_libs: [
501 "modules-utils-build_system",
502 "modules-utils-statemachine",
503 "net-utils-non-bootclasspath-aidl-java",
504 "netd-client",
505 ],
506 apex_available: [
507 "com.android.tethering",
508 "//apex_available:platform",
509 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000510 defaults_visibility: [
511 "//visibility:private",
512 ],
513 lint: {
514 strict_updatability_linting: true,
515 error_checks: ["NewApi"],
516 },
517}
518
Handa Wang8be10bf2024-08-08 15:36:48 +0000519// net-utils-service-connectivity is only for service-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000520java_library {
521 name: "net-utils-service-connectivity",
522 srcs: [
523 ":net-utils-all-srcs",
524 ],
525 exclude_srcs: [
526 ":net-utils-framework-connectivity-srcs",
527 ],
528 libs: [
529 "net-utils-framework-connectivity",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000530 "framework-connectivity.impl",
531 "framework-tethering.impl",
Handa Wang9b0df362024-07-02 13:17:43 +0000532 ],
533 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000534 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000535 visibility: [
536 "//packages/modules/Connectivity/service",
537 "//packages/modules/Connectivity/staticlibs/tests/unit",
538 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000539}
540
Remi NGUYEN VAN514f40b2024-08-15 08:07:02 +0000541// net-utils-connectivity-apks is only for NetworkStack, CaptivePortalLogin and
542// Tethering.apk
543// It includes all the static libraries in this directory, which is safe because
544// these APKs use R8 to strip out unused code, and they do not depend on
545// bootclasspath jars that may have duplicate copies of the included classes
546// with the same jarjaring.
547// Tethering.apk does depend on a bootclasspath jar (framework-tethering.jar),
548// however it does not use any of the static libraries. If it did, Tethering.apk
549// would need to use another variant that excludes classes that are already
550// included in framework-tethering.jar (similarly to how framework-connectivity
551// and service-connectivity do it). Otherwise, static libs included in
552// framework-tethering and Tethering.apk and jarjared the same way would
553// conflict.
Handa Wang9b0df362024-07-02 13:17:43 +0000554java_library {
Xiao Ma6793fd02024-07-26 13:07:50 +0900555 name: "net-utils-connectivity-apks",
Handa Wang9b0df362024-07-02 13:17:43 +0000556 srcs: [
557 ":net-utils-all-srcs",
558 ":framework-connectivity-shared-srcs",
559 ],
560 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000561 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000562 visibility: [
563 "//packages/modules/CaptivePortalLogin:__subpackages__",
564 "//packages/modules/Connectivity/Tethering",
565 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000566}
567
568aidl_interface {
569 name: "net-utils-non-bootclasspath-aidl",
570 srcs: [
571 ":net-utils-aidl-srcs",
572 ],
573 unstable: true,
574 backend: {
575 java: {
576 enabled: true,
577 min_sdk_version: "30",
578 apex_available: [
579 "com.android.tethering",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000580 "com.android.wifi",
Xiao Mab28199a2024-08-05 14:24:26 +0900581 "//apex_available:platform",
Handa Wang9b0df362024-07-02 13:17:43 +0000582 ],
583 },
584 cpp: {
585 enabled: false,
586 },
587 ndk: {
588 enabled: false,
589 },
590 rust: {
591 enabled: false,
592 },
593 },
594 include_dirs: [
595 "packages/modules/Connectivity/framework/aidl-export",
596 ],
597 visibility: [
598 "//system/tools/aidl/build",
599 ],
600}
601
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900602// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
603// included either (some annotations would be duplicated on the bootclasspath).
604filegroup {
605 name: "net-utils-telephony-common-srcs",
606 srcs: [
607 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900608 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900609 "device/android/net/NetworkFactoryImpl.java",
610 "device/android/net/NetworkFactoryLegacyImpl.java",
611 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900612 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900613 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900614 visibility: [
615 "//frameworks/opt/telephony",
616 ],
617}
Roshan Pius864bdec2020-01-16 09:19:11 -0800618
Nate Jiang5f0471c2024-07-12 16:49:52 +0000619// Filegroup to build lib used by Wifi framework
Roshan Pius864bdec2020-01-16 09:19:11 -0800620// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
621filegroup {
622 name: "net-utils-framework-wifi-common-srcs",
623 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900624 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
625 "framework/com/android/net/module/util/Inet4AddressUtils.java",
626 "framework/com/android/net/module/util/InetAddressUtils.java",
627 "framework/com/android/net/module/util/MacAddressUtils.java",
628 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800629 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900630 path: "framework",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000631 visibility: ["//visibility:private"],
Roshan Pius864bdec2020-01-16 09:19:11 -0800632}
Handa Wang9b0df362024-07-02 13:17:43 +0000633
Yan Yan61f779c2024-10-01 15:07:51 -0700634// Filegroup to build lib used by IPsec/IKE framework
635// Any class here *must* have a corresponding jarjar rule in the IPsec build rules.
636filegroup {
637 name: "net-utils-framework-ipsec-common-srcs",
638 srcs: [
639 "framework/com/android/net/module/util/HexDump.java",
640 ],
641 path: "framework",
642 visibility: ["//visibility:private"],
643}
644
645java_library {
646 name: "net-utils-framework-ipsec",
647 sdk_version: "module_current",
648 min_sdk_version: "30",
649 srcs: [":net-utils-framework-ipsec-common-srcs"],
650 libs: [
651 "androidx.annotation_annotation",
652 ],
653 visibility: [
654 "//packages/modules/IPsec",
655 ],
656 apex_available: ["com.android.ipsec"],
657}
658
Handa Wang9b0df362024-07-02 13:17:43 +0000659// Use a file group containing classes necessary for framework-connectivity. The file group should
660// be as small as possible because because the classes end up in the bootclasspath and R8 is not
661// used to remove unused classes.
662filegroup {
663 name: "net-utils-framework-connectivity-srcs",
664 srcs: [
665 "device/com/android/net/module/util/BpfBitmap.java",
666 "device/com/android/net/module/util/BpfDump.java",
667 "device/com/android/net/module/util/BpfMap.java",
668 "device/com/android/net/module/util/BpfUtils.java",
669 "device/com/android/net/module/util/IBpfMap.java",
670 "device/com/android/net/module/util/JniUtil.java",
671 "device/com/android/net/module/util/SingleWriterBpfMap.java",
672 "device/com/android/net/module/util/Struct.java",
673 "device/com/android/net/module/util/TcUtils.java",
674 "framework/com/android/net/module/util/HexDump.java",
675 ],
676 visibility: ["//visibility:private"],
677}
678
679filegroup {
680 name: "net-utils-all-srcs",
681 srcs: [
682 "device/**/*.java",
Handa Wang69aee7b2024-08-16 08:56:41 +0000683 ":framework-connectivity-shared-srcs",
Handa Wang9b0df362024-07-02 13:17:43 +0000684 ":net-utils-framework-common-srcs",
685 ],
686 visibility: ["//visibility:private"],
687}
688
689filegroup {
690 name: "net-utils-aidl-srcs",
691 srcs: [
692 "device/**/*.aidl",
693 ],
694 path: "device",
695 visibility: ["//visibility:private"],
696}
Nate Jiang5f0471c2024-07-12 16:49:52 +0000697
698java_library {
699 name: "net-utils-service-wifi",
700 srcs: [
701 ":net-utils-all-srcs",
702 ],
703 exclude_srcs: [":net-utils-framework-wifi-common-srcs"],
704 libs: [
705 "net-utils-framework-wifi",
706 ],
707 defaults: ["net-utils-non-bootclasspath-defaults"],
708
709 visibility: [
710 "//packages/modules/Wifi/service",
711 ],
712 apex_available: [
713 "com.android.wifi",
714 ],
715}
716
717java_library {
718 name: "net-utils-framework-wifi",
719 sdk_version: "module_current",
720 min_sdk_version: "30",
721 srcs: [":net-utils-framework-wifi-common-srcs"],
722 libs: [
723 "framework-annotations-lib",
724 "framework-connectivity.stubs.module_lib",
725 "unsupportedappusage",
726 ],
727 visibility: [
728 "//packages/modules/Wifi/framework",
729 ],
730 apex_available: ["com.android.wifi"],
731}