blob: 24d8ccaa28a4a6349299035fd528ba44e3c8d49a [file] [log] [blame]
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +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 Badour727b6722021-02-12 17:07:05 -080017package {
18 // See: http://go/android-license-faq
Baligh Uddin2afd0982021-05-24 03:50:01 +000019 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour727b6722021-02-12 17:07:05 -080020}
21
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090022filegroup {
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090023 name: "framework-connectivity-internal-sources",
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090024 srcs: [
25 "src/**/*.java",
26 "src/**/*.aidl",
27 ],
28 path: "src",
29 visibility: [
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090030 "//visibility:private",
31 ],
32}
33
34filegroup {
35 name: "framework-connectivity-aidl-export-sources",
36 srcs: [
37 "aidl-export/**/*.aidl",
38 ],
39 path: "aidl-export",
40 visibility: [
41 "//visibility:private",
42 ],
43}
44
45// TODO: use a java_library in the bootclasspath instead
46filegroup {
47 name: "framework-connectivity-sources",
48 srcs: [
49 ":framework-connectivity-internal-sources",
50 ":framework-connectivity-aidl-export-sources",
51 ],
52 visibility: [
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090053 "//frameworks/base",
54 "//packages/modules/Connectivity:__subpackages__",
55 ],
Bob Badour727b6722021-02-12 17:07:05 -080056}
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090057
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090058java_defaults {
59 name: "framework-connectivity-defaults",
60 defaults: ["framework-module-defaults"],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090061 sdk_version: "module_current",
62 min_sdk_version: "30",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090063 srcs: [
64 ":framework-connectivity-sources",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090065 ":net-utils-framework-common-srcs",
Junyu Laieb6f4be2022-01-17 11:52:57 +000066 ":framework-connectivity-api-shared-srcs",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090067 ],
68 aidl: {
Siim Sammulcd4c8222021-12-13 15:52:07 +000069 generate_get_transaction_name: true,
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090070 include_dirs: [
71 // Include directories for parcelables that are part of the stable API, and need a
72 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
73 // TODO(b/180293679): remove these dependencies as they should not be necessary once
74 // the module builds against API (the parcelable declarations exist in framework.aidl)
75 "frameworks/base/core/java", // For framework parcelables
76 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
77 ],
78 },
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090079 stub_only_libs: [
paulhu537f7202022-02-08 21:25:28 +080080 "framework-connectivity-t.stubs.module_lib",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090081 ],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090082 impl_only_libs: [
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090083 "framework-tethering.stubs.module_lib",
84 "framework-wifi.stubs.module_lib",
85 "net-utils-device-common",
86 ],
Chalard Jeandece0d82021-11-15 18:17:33 +090087 static_libs: [
paulhu541b72d2022-02-09 14:02:43 +080088 "mdns_aidl_interface-lateststable-java",
Xiao Ma0a171c02022-01-23 16:14:51 +000089 "modules-utils-backgroundthread",
Chalard Jeandece0d82021-11-15 18:17:33 +090090 "modules-utils-build",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090091 "modules-utils-preconditions",
Vinh Tran6d8c1d72022-06-08 01:25:14 -040092 "framework-connectivity-javastream-protos",
Chalard Jeandece0d82021-11-15 18:17:33 +090093 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090094 libs: [
Taras Antoshchuk30d41e52021-08-02 18:06:35 +020095 "app-compat-annotations",
paulhu537f7202022-02-08 21:25:28 +080096 "framework-connectivity-t.stubs.module_lib",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090097 "unsupportedappusage",
98 ],
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090099 apex_available: [
100 "com.android.tethering",
101 ],
102 lint: { strict_updatability_linting: true },
103}
104
105java_library {
106 name: "framework-connectivity-pre-jarjar",
107 defaults: ["framework-connectivity-defaults"],
108 libs: [
109 // This cannot be in the defaults clause above because if it were, it would be used
110 // to generate the connectivity stubs. That would create a circular dependency
111 // because the tethering stubs depend on the connectivity stubs (e.g.,
112 // TetheringRequest depends on LinkAddress).
113 "framework-tethering.stubs.module_lib",
114 ],
115 visibility: ["//packages/modules/Connectivity:__subpackages__"]
116}
117
118java_sdk_library {
119 name: "framework-connectivity",
120 defaults: ["framework-connectivity-defaults"],
121 installable: true,
Colin Crossece31712022-05-18 18:23:18 +0000122 jarjar_rules: ":connectivity-jarjar-rules",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000123 permitted_packages: ["android.net"],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900124 impl_library_visibility: [
125 "//packages/modules/Connectivity/Tethering/apex",
126 // In preparation for future move
127 "//packages/modules/Connectivity/apex",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +0900128 "//packages/modules/Connectivity/framework-t",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900129 "//packages/modules/Connectivity/service",
paulhu802ab972021-12-14 01:30:22 +0000130 "//packages/modules/Connectivity/service-t",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900131 "//frameworks/base/packages/Connectivity/service",
132 "//frameworks/base",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000133
134 // Tests using hidden APIs
Chiachang Wang32708712021-04-14 11:48:19 +0800135 "//cts/tests/netlegacy22.api",
Lorenzo Colittieb8d8552022-02-01 13:51:42 +0900136 "//cts/tests/tests/app.usage", // NetworkUsageStatsTest
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000137 "//external/sl4a:__subpackages__",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +0000138 "//frameworks/base/packages/Connectivity/tests:__subpackages__",
Remi NGUYEN VAN85a4e072022-02-02 20:06:56 +0900139 "//frameworks/base/core/tests/bandwidthtests",
140 "//frameworks/base/core/tests/benchmarks",
141 "//frameworks/base/core/tests/utillib",
Aaron Huang720ad7c2022-01-26 00:43:10 +0800142 "//frameworks/base/tests/vcn",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000143 "//frameworks/libs/net/common/testutils",
144 "//frameworks/libs/net/common/tests:__subpackages__",
Xiao Ma0a171c02022-01-23 16:14:51 +0000145 "//frameworks/opt/net/ethernet/tests:__subpackages__",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000146 "//frameworks/opt/telephony/tests/telephonytests",
Chiachang Wang426a6de2021-04-13 11:15:36 +0800147 "//packages/modules/CaptivePortalLogin/tests",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000148 "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
149 "//packages/modules/Connectivity/tests:__subpackages__",
Aaron Huang720ad7c2022-01-26 00:43:10 +0800150 "//packages/modules/IPsec/tests/iketests",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000151 "//packages/modules/NetworkStack/tests:__subpackages__",
Chiachang Wange9d848e2021-03-31 16:11:37 +0800152 "//packages/modules/Wifi/service/tests/wifitests",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900153 ],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000154}
155
Taras Antoshchuk30d41e52021-08-02 18:06:35 +0200156platform_compat_config {
157 name: "connectivity-platform-compat-config",
158 src: ":framework-connectivity",
159}
160
Remi NGUYEN VANdeed4cb2021-04-02 06:38:46 +0000161cc_library_shared {
162 name: "libframework-connectivity-jni",
163 min_sdk_version: "30",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000164 cflags: [
165 "-Wall",
166 "-Werror",
167 "-Wno-unused-parameter",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000168 // Don't warn about S API usage even with
169 // min_sdk 30: the library is only loaded
170 // on S+ devices
171 "-Wno-unguarded-availability",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000172 "-Wthread-safety",
173 ],
Remi NGUYEN VANdeed4cb2021-04-02 06:38:46 +0000174 srcs: [
175 "jni/android_net_NetworkUtils.cpp",
176 "jni/onload.cpp",
177 ],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000178 shared_libs: [
Remi NGUYEN VANdeed4cb2021-04-02 06:38:46 +0000179 "libandroid",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000180 "liblog",
181 "libnativehelper",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000182 ],
183 header_libs: [
184 "dnsproxyd_protocol_headers",
185 ],
Remi NGUYEN VANdeed4cb2021-04-02 06:38:46 +0000186 stl: "none",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000187 apex_available: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000188 "com.android.tethering",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000189 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900190}
Junyu Laieb6f4be2022-01-17 11:52:57 +0000191
Aaron Huangdac7e4b2022-02-14 21:38:14 +0800192filegroup {
Junyu Laieb6f4be2022-01-17 11:52:57 +0000193 name: "framework-connectivity-protos",
Junyu Laieb6f4be2022-01-17 11:52:57 +0000194 srcs: [
Aaron Huangdac7e4b2022-02-14 21:38:14 +0800195 "proto/**/*.proto",
Junyu Laieb6f4be2022-01-17 11:52:57 +0000196 ],
Aaron Huangdac7e4b2022-02-14 21:38:14 +0800197 visibility: ["//frameworks/base"],
198}
199
Vinh Tran6d8c1d72022-06-08 01:25:14 -0400200java_library {
Aaron Huangdac7e4b2022-02-14 21:38:14 +0800201 name: "framework-connectivity-javastream-protos",
Vinh Tran6d8c1d72022-06-08 01:25:14 -0400202 proto: {
203 type: "stream",
204 },
205 srcs: [":framework-connectivity-protos"],
206 installable: false,
207 sdk_version: "module_current",
208 min_sdk_version: "30",
209 apex_available: [
210 "com.android.tethering",
Junyu Laieb6f4be2022-01-17 11:52:57 +0000211 ],
Junyu Laieb6f4be2022-01-17 11:52:57 +0000212}