blob: 7a4fb33f4a8ee29e33840dfe3463b05d1034c69d [file] [log] [blame]
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +09001//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badour6c7ed9d2021-02-12 17:07:05 -080017package {
18 // See: http://go/android-license-faq
Baligh Uddin36847132021-05-23 16:38:40 +000019 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour6c7ed9d2021-02-12 17:07:05 -080020}
21
Tyler Wearb37f5512021-10-01 13:22:00 -070022aidl_interface {
23 name: "connectivity_native_aidl_interface",
24 local_include_dir: "binder",
25 vendor_available: true,
26 srcs: [
27 "binder/android/net/connectivity/aidl/*.aidl",
28 ],
29 backend: {
30 java: {
31 apex_available: [
32 "com.android.tethering",
33 ],
34 min_sdk_version: "30",
35 },
36 ndk: {
37 apex_available: [
38 "com.android.tethering",
39 ],
40 min_sdk_version: "30",
41 },
42 },
43 versions: ["1"],
44
45}
46
47cc_library_static {
48 name: "connectivity_native_aidl_interface-lateststable-ndk",
49 min_sdk_version: "30",
50 whole_static_libs: [
51 "connectivity_native_aidl_interface-V1-ndk",
52 ],
53 apex_available: [
54 "com.android.tethering",
55 ],
56}
57
58java_library {
59 name: "connectivity_native_aidl_interface-lateststable-java",
60 sdk_version: "system_current",
61 min_sdk_version: "30",
62 static_libs: [
63 "connectivity_native_aidl_interface-V1-java",
64 ],
65 apex_available: [
66 "com.android.tethering",
67 ],
68}
69
markchien8fb75e32021-11-11 17:53:56 +080070// The library name match the service-connectivity jarjar rules that put the JNI utils in the
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090071// android.net.connectivity.com.android.net.module.util package.
markchien8fb75e32021-11-11 17:53:56 +080072cc_library_shared {
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090073 name: "libandroid_net_connectivity_com_android_net_module_util_jni",
markchien8fb75e32021-11-11 17:53:56 +080074 min_sdk_version: "30",
75 cflags: [
76 "-Wall",
77 "-Werror",
78 "-Wno-unused-parameter",
79 "-Wthread-safety",
80 ],
81 srcs: [
82 "jni/com_android_net_module_util/onload.cpp",
83 ],
markchien8fb75e32021-11-11 17:53:56 +080084 static_libs: [
85 "libnet_utils_device_common_bpfjni",
Tyler Wearb37f5512021-10-01 13:22:00 -070086 "libnet_utils_device_common_bpfutils",
markchien8fb75e32021-11-11 17:53:56 +080087 ],
88 shared_libs: [
89 "liblog",
90 "libnativehelper",
91 ],
92 apex_available: [
93 "com.android.tethering",
94 ],
95}
96
Remi NGUYEN VANeaa96582021-01-08 01:19:44 +000097cc_library_shared {
98 name: "libservice-connectivity",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +000099 min_sdk_version: "30",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900100 cflags: [
101 "-Wall",
102 "-Werror",
103 "-Wno-unused-parameter",
104 "-Wthread-safety",
105 ],
106 srcs: [
Remi NGUYEN VANd9504892022-02-02 13:03:29 +0900107 ":services.connectivity-netstats-jni-sources",
Patrick Rohr361b8592022-01-28 15:39:17 +0100108 "jni/com_android_server_BpfNetMaps.cpp",
Hungming Chene2cf0552021-12-25 17:05:41 +0800109 "jni/com_android_server_connectivity_ClatCoordinator.cpp",
Patrick Rohr361b8592022-01-28 15:39:17 +0100110 "jni/com_android_server_TestNetworkService.cpp",
Remi NGUYEN VANeaa96582021-01-08 01:19:44 +0000111 "jni/onload.cpp",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900112 ],
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000113 header_libs: [
Patrick Rohr361b8592022-01-28 15:39:17 +0100114 "bpf_connectivity_headers",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000115 ],
Hungming Chene2cf0552021-12-25 17:05:41 +0800116 static_libs: [
117 "libclat",
118 "libip_checksum",
Remi NGUYEN VANd9504892022-02-02 13:03:29 +0900119 "libmodules-utils-build",
Hungming Chene2cf0552021-12-25 17:05:41 +0800120 "libnetjniutils",
Remi NGUYEN VANd9504892022-02-02 13:03:29 +0900121 "libnet_utils_device_common_bpfjni",
Patrick Rohr361b8592022-01-28 15:39:17 +0100122 "libtraffic_controller",
123 "netd_aidl_interface-lateststable-ndk",
Hungming Chene2cf0552021-12-25 17:05:41 +0800124 ],
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900125 shared_libs: [
Maciej Żenczykowskidcae3512022-01-31 19:59:32 -0800126 "libbase",
Remi NGUYEN VANd9504892022-02-02 13:03:29 +0900127 "libcutils",
Maciej Żenczykowskidcae3512022-01-31 19:59:32 -0800128 "libnetdutils",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900129 "liblog",
130 "libnativehelper",
Remi NGUYEN VANd9504892022-02-02 13:03:29 +0900131 "libnetworkstats",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900132 ],
Pete Bentleyb1456112021-01-07 13:51:18 +0000133 apex_available: [
Remi NGUYEN VANeaa96582021-01-08 01:19:44 +0000134 "com.android.tethering",
Pete Bentleyb1456112021-01-07 13:51:18 +0000135 ],
136}
137
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900138java_library {
Aaron Huang63338842021-01-08 18:32:00 +0800139 name: "service-connectivity-pre-jarjar",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000140 sdk_version: "system_server_current",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000141 min_sdk_version: "30",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900142 srcs: [
Remi NGUYEN VANcdb45f82021-05-13 12:53:15 +0000143 "src/**/*.java",
Aaron Huang63338842021-01-08 18:32:00 +0800144 ":framework-connectivity-shared-srcs",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000145 ":services-connectivity-shared-srcs",
Remi NGUYEN VAN58cd2452021-07-07 17:45:45 +0900146 // TODO: move to net-utils-device-common
147 ":connectivity-module-utils-srcs",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900148 ],
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900149 libs: [
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000150 "framework-annotations-lib",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +0900151 "framework-connectivity-pre-jarjar",
paulhu537f7202022-02-08 21:25:28 +0800152 "framework-connectivity-t.stubs.module_lib",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000153 "framework-tethering.stubs.module_lib",
154 "framework-wifi.stubs.module_lib",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900155 "unsupportedappusage",
Remi NGUYEN VAN907ebd42021-03-08 22:05:03 +0900156 "ServiceConnectivityResources",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900157 ],
158 static_libs: [
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +0900159 // Do not add libs here if they are already included
160 // in framework-connectivity
Hungming Chen01f25502022-06-28 22:47:00 +0800161 "connectivity-net-module-utils-bpf",
Tyler Wearb37f5512021-10-01 13:22:00 -0700162 "connectivity_native_aidl_interface-lateststable-java",
Remi NGUYEN VAN30bebea2021-08-06 14:15:31 +0900163 "dnsresolver_aidl_interface-V9-java",
William Escandeea9e22e2021-08-19 12:26:52 +0200164 "modules-utils-shell-command-handler",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900165 "net-utils-device-common",
markchien8fb75e32021-11-11 17:53:56 +0800166 "net-utils-device-common-bpf",
Xiao Ma09c07272021-07-01 14:00:34 +0000167 "net-utils-device-common-netlink",
Xiao Ma0a171c02022-01-23 16:14:51 +0000168 "net-utils-services-common",
lucaslinef337532021-01-18 11:58:24 +0800169 "netd-client",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000170 "networkstack-client",
lifrc0d25c12021-03-09 17:24:46 +0800171 "PlatformProperties",
Remi NGUYEN VANd8bc0fa2021-03-11 15:41:52 +0900172 "service-connectivity-protos",
Remi NGUYEN VANed02d612022-05-13 16:36:55 +0900173 "NetworkStackApiStableShims",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900174 ],
175 apex_available: [
Remi NGUYEN VANeaa96582021-01-08 01:19:44 +0000176 "com.android.tethering",
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900177 ],
Chiachang Wang3bc52762021-11-25 14:17:57 +0800178 lint: { strict_updatability_linting: true },
paulhu802ab972021-12-14 01:30:22 +0000179 visibility: [
180 "//packages/modules/Connectivity/service-t",
181 "//packages/modules/Connectivity/tests:__subpackages__",
182 ],
Remi NGUYEN VAN59262cb2020-12-21 18:40:08 +0900183}
Aaron Huang63338842021-01-08 18:32:00 +0800184
Paul Hu3e1f4482022-05-16 20:56:32 +0800185// TODO: Remove this temporary library and put code into module when test coverage is enough.
186java_library {
187 name: "service-mdns",
188 sdk_version: "system_server_current",
189 min_sdk_version: "30",
190 srcs: [
191 "mdns/**/*.java",
192 ],
193 libs: [
194 "framework-annotations-lib",
195 "framework-connectivity-pre-jarjar",
196 "framework-wifi.stubs.module_lib",
197 "service-connectivity-pre-jarjar",
198 ],
199 visibility: [
200 "//packages/modules/Connectivity/tests:__subpackages__",
201 ],
202}
203
Aaron Huang63338842021-01-08 18:32:00 +0800204java_library {
Remi NGUYEN VANd8bc0fa2021-03-11 15:41:52 +0900205 name: "service-connectivity-protos",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000206 sdk_version: "system_current",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000207 min_sdk_version: "30",
Remi NGUYEN VANd8bc0fa2021-03-11 15:41:52 +0900208 proto: {
209 type: "nano",
210 },
211 srcs: [
212 ":system-messages-proto-src",
213 ],
214 libs: ["libprotobuf-java-nano"],
215 apex_available: [
Remi NGUYEN VANd8bc0fa2021-03-11 15:41:52 +0900216 "com.android.tethering",
217 ],
Chiachang Wang3bc52762021-11-25 14:17:57 +0800218 lint: { strict_updatability_linting: true },
Remi NGUYEN VANd8bc0fa2021-03-11 15:41:52 +0900219}
220
Paul Duffin5fc809f2022-05-20 14:15:42 +0000221java_defaults {
222 name: "service-connectivity-defaults",
Remi NGUYEN VAN4ee6c502021-03-22 10:25:12 +0000223 sdk_version: "system_server_current",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000224 min_sdk_version: "30",
paulhu802ab972021-12-14 01:30:22 +0000225 // This library combines system server jars that have access to different bootclasspath jars.
226 // Lower SDK service jars must not depend on higher SDK jars as that would let them
227 // transitively depend on the wrong bootclasspath jars. Sources also cannot be added here as
228 // they would transitively depend on bootclasspath jars that may not be available.
lifrc0d25c12021-03-09 17:24:46 +0800229 static_libs: [
Aaron Huang63338842021-01-08 18:32:00 +0800230 "service-connectivity-pre-jarjar",
paulhu802ab972021-12-14 01:30:22 +0000231 "service-connectivity-tiramisu-pre-jarjar",
Remi NGUYEN VANb6cde3d2022-03-10 04:32:15 +0000232 "service-nearby-pre-jarjar",
Aaron Huang63338842021-01-08 18:32:00 +0800233 ],
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +0900234 jarjar_rules: ":connectivity-jarjar-rules",
Aaron Huang63338842021-01-08 18:32:00 +0800235 apex_available: [
Aaron Huang63338842021-01-08 18:32:00 +0800236 "com.android.tethering",
237 ],
Remi NGUYEN VANc6f8fb02022-04-20 18:58:53 +0900238 optimize: {
239 enabled: true,
240 shrink: true,
241 proguard_flags_files: ["proguard.flags"],
242 },
Chiachang Wang3bc52762021-11-25 14:17:57 +0800243 lint: { strict_updatability_linting: true },
Aaron Huang63338842021-01-08 18:32:00 +0800244}
Remi NGUYEN VAN8ea5ee62021-06-28 18:48:43 +0900245
Paul Duffin5fc809f2022-05-20 14:15:42 +0000246// A special library created strictly for use by the tests as they need the
247// implementation library but that is not available when building from prebuilts.
248// Using a library with a different name to what is used by the prebuilts ensures
249// that this will never depend on the prebuilt.
250// Switching service-connectivity to a java_sdk_library would also have worked as
251// that has built in support for managing this but that is too big a change at this
252// point.
253java_library {
254 name: "service-connectivity-for-tests",
255 defaults: ["service-connectivity-defaults"],
256}
257
258java_library {
259 name: "service-connectivity",
260 defaults: ["service-connectivity-defaults"],
261 installable: true,
262}
263
Colin Crossece31712022-05-18 18:23:18 +0000264filegroup {
Remi NGUYEN VAN8ea5ee62021-06-28 18:48:43 +0900265 name: "connectivity-jarjar-rules",
Colin Crossece31712022-05-18 18:23:18 +0000266 srcs: ["jarjar-rules.txt"],
Remi NGUYEN VAN8ea5ee62021-06-28 18:48:43 +0900267 visibility: ["//packages/modules/Connectivity:__subpackages__"],
268}
Wayne Ma0ea3bdc2022-01-12 01:12:11 +0800269
270// TODO: This filegroup temporary exposes for NetworkStats. It should be
271// removed right after NetworkStats moves into mainline module.
272filegroup {
273 name: "traffic-controller-utils",
274 srcs: ["src/com/android/server/BpfNetMaps.java"],
275 visibility: ["//packages/modules/Connectivity:__subpackages__"],
276}