blob: 3f35c6b6c4f57aef21c060bb37df4a086840cbcc [file] [log] [blame]
markchien0abdd112019-11-28 10:17:03 +08001//
2// Copyright (C) 2019 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 Badour97e6be22021-02-12 14:45:04 -080017package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Maciej Żenczykowski760d1ed2022-07-08 05:57:10 -070021prebuilt_etc {
22 name: "TetheringInProcessFlag",
23 src: "in-process",
24 filename_from_src: true,
25 sub_dir: "flag",
26}
27
28prebuilt_etc {
29 name: "TetheringOutOfProcessFlag",
30 src: "out-of-process",
31 filename_from_src: true,
32 sub_dir: "flag",
33}
34
markchien598a75b2021-11-22 10:36:32 +080035// Defaults to enable/disable java targets which uses development APIs. "enabled" may have a
36// different value depending on the branch.
37java_defaults {
38 name: "ConnectivityNextEnableDefaults",
39 enabled: true,
40}
Remi NGUYEN VAN02eee9a2023-01-30 19:19:48 +090041java_defaults {
42 name: "NetworkStackApiShimSettingsForCurrentBranch",
43 // API shims to include in the networking modules built from the branch. Branches that disable
44 // the "next" targets must use stable shims (latest stable API level) instead of current shims
45 // (X_current API level).
46 static_libs: ["NetworkStackApiCurrentShims"],
47}
markchien598a75b2021-11-22 10:36:32 +080048apex_defaults {
49 name: "ConnectivityApexDefaults",
50 // Tethering app to include in the AOSP apex. Branches that disable the "next" targets may use
51 // a stable tethering app instead, but will generally override the AOSP apex to use updatable
52 // package names and keys, so that apex will be unused anyway.
53 apps: ["TetheringNext"], // Replace to "Tethering" if ConnectivityNextEnableDefaults is false.
54}
Remi NGUYEN VANf24553d2022-01-27 13:16:12 +090055enable_tethering_next_apex = true
markchien598a75b2021-11-22 10:36:32 +080056// This is a placeholder comment to avoid merge conflicts
57// as the above target may have different "enabled" values
58// depending on the branch
59
Patrick Rohrc65b4512023-01-16 06:12:04 -080060// cronet_in_tethering_apex_defaults can be used to specify an apex_defaults target that either
61// enables or disables inclusion of Cronet in the Tethering apex. This is used to disable Cronet
62// on tm-mainline-prod. Note: in order for Cronet APIs to work Cronet must also be enabled
63// by the cronet_java_*_defaults in common/TetheringLib/Android.bp.
64cronet_in_tethering_apex_defaults = "CronetInTetheringApexDefaultsEnabled"
65// This is a placeholder comment to avoid merge conflicts
66// as cronet_apex_defaults may have different values
67// depending on the branch
68
Dan Stahre2be25f2023-01-16 18:02:30 +000069apex_defaults {
70 name: "CronetInTetheringApexDefaults",
71 defaults: [cronet_in_tethering_apex_defaults],
72}
73
74apex_defaults {
75 name: "CronetInTetheringApexDefaultsEnabled",
Stefano Duo43d89f62023-03-15 16:11:52 +000076 jni_libs: [
Mohannad Farrag9c6801f2023-03-23 12:45:45 +000077 "cronet_aml_components_cronet_android_cronet",
Stefano Duo43d89f62023-03-15 16:11:52 +000078 "//external/cronet/third_party/boringssl:libcrypto",
79 "//external/cronet/third_party/boringssl:libssl",
80 ],
Dan Stahre2be25f2023-01-16 18:02:30 +000081 arch: {
82 riscv64: {
83 // TODO: remove this when there is a riscv64 libcronet
Stefano Duo43d89f62023-03-15 16:11:52 +000084 exclude_jni_libs: [
Mohannad Farrag9c6801f2023-03-23 12:45:45 +000085 "cronet_aml_components_cronet_android_cronet",
Stefano Duo43d89f62023-03-15 16:11:52 +000086 "//external/cronet/third_party/boringssl:libcrypto",
87 "//external/cronet/third_party/boringssl:libssl",
88 ],
Dan Stahre2be25f2023-01-16 18:02:30 +000089 },
90 },
91}
92
93apex_defaults {
94 name: "CronetInTetheringApexDefaultsDisabled",
95}
96
markchien0abdd112019-11-28 10:17:03 +080097apex {
markchien8f831c02019-12-18 17:47:26 +080098 name: "com.android.tethering",
Gurpreet Singha12858d2022-03-04 15:34:29 +000099 defaults: [
100 "ConnectivityApexDefaults",
Dan Stahre2be25f2023-01-16 18:02:30 +0000101 "CronetInTetheringApexDefaults",
Gurpreet Singha12858d2022-03-04 15:34:29 +0000102 "r-launched-apex-module",
103 ],
Remi NGUYEN VAN6d575ca2021-01-13 15:44:38 +0900104 compile_multilib: "both",
satayev8bb425a2021-05-12 13:28:58 +0100105 bootclasspath_fragments: [
106 "com.android.tethering-bootclasspath-fragment",
107 ],
Jiakai Zhang9ecc66d2021-12-20 16:54:13 +0000108 systemserverclasspath_fragments: [
109 "com.android.tethering-systemserverclasspath-fragment",
Remi NGUYEN VAN2812f602021-01-08 01:19:44 +0000110 ],
Remi NGUYEN VAN6d575ca2021-01-13 15:44:38 +0900111 multilib: {
112 first: {
markchien8fb75e32021-11-11 17:53:56 +0800113 jni_libs: [
114 "libservice-connectivity",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +0900115 "libandroid_net_connectivity_com_android_net_module_util_jni",
markchien8fb75e32021-11-11 17:53:56 +0800116 ],
Remi NGUYEN VANfb70eba2022-04-04 20:26:16 +0900117 native_shared_libs: [
118 "libcom.android.tethering.connectivity_native",
119 "libnetd_updatable",
120 ],
Remi NGUYEN VAN6d575ca2021-01-13 15:44:38 +0900121 },
122 both: {
Remi NGUYEN VANc8aa43c2022-02-02 13:03:29 +0900123 jni_libs: [
124 "libframework-connectivity-jni",
125 "libframework-connectivity-tiramisu-jni"
126 ],
Paul Duffinb28cb442021-05-26 10:46:20 +0100127 },
Remi NGUYEN VAN6d575ca2021-01-13 15:44:38 +0900128 },
Hungming Chen378e3232021-12-16 21:56:02 +0800129 binaries: [
130 "clatd",
131 ],
Hungming Chenf9d40ae2022-01-14 17:42:43 +0800132 canned_fs_config: "canned_fs_config",
Maciej Żenczykowskie9810ff2021-01-14 20:02:08 -0800133 bpfs: [
Tyler Wearb37f5512021-10-01 13:22:00 -0700134 "block.o",
Maciej Żenczykowskid72a5a72022-05-02 00:43:51 -0700135 "clatd.o",
Ken Chen74ff3ee2022-07-14 16:46:39 +0800136 "dscpPolicy.o",
Maciej Żenczykowskid72a5a72022-05-02 00:43:51 -0700137 "netd.o",
Maciej Żenczykowskie9810ff2021-01-14 20:02:08 -0800138 "offload.o",
Maciej Żenczykowski07d30132022-04-23 12:33:32 -0700139 "offload@btf.o",
Maciej Żenczykowskie9810ff2021-01-14 20:02:08 -0800140 "test.o",
Maciej Żenczykowski07d30132022-04-23 12:33:32 -0700141 "test@btf.o",
Maciej Żenczykowskie9810ff2021-01-14 20:02:08 -0800142 ],
Remi NGUYEN VANaffd94b2021-03-08 23:09:31 +0900143 apps: [
144 "ServiceConnectivityResources",
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900145 "HalfSheetUX",
Remi NGUYEN VANaffd94b2021-03-08 23:09:31 +0900146 ],
Andrei Onea52eac022021-12-03 15:11:27 +0000147 prebuilts: [
148 "current_sdkinfo",
149 "privapp_allowlist_com.android.tethering",
Maciej Żenczykowski760d1ed2022-07-08 05:57:10 -0700150 "TetheringOutOfProcessFlag",
Andrei Onea52eac022021-12-03 15:11:27 +0000151 ],
markchien0abdd112019-11-28 10:17:03 +0800152 manifest: "manifest.json",
markchien8f831c02019-12-18 17:47:26 +0800153 key: "com.android.tethering.key",
Nikita Ioffe5f333572021-02-04 01:42:45 +0000154 // Indicates that pre-installed version of this apex can be compressed.
155 // Whether it actually will be compressed is controlled on per-device basis.
156 compressible: true,
markchien0abdd112019-11-28 10:17:03 +0800157
158 androidManifest: "AndroidManifest.xml",
Taras Antoshchuk30d41e52021-08-02 18:06:35 +0200159
Remi NGUYEN VAN348bbb02022-07-19 16:33:04 +0900160 compat_configs: [
161 "connectivity-platform-compat-config",
Remi NGUYEN VAN348bbb02022-07-19 16:33:04 +0900162 ],
markchien0abdd112019-11-28 10:17:03 +0800163}
164
165apex_key {
markchien8f831c02019-12-18 17:47:26 +0800166 name: "com.android.tethering.key",
167 public_key: "com.android.tethering.avbpubkey",
168 private_key: "com.android.tethering.pem",
markchien0abdd112019-11-28 10:17:03 +0800169}
170
171android_app_certificate {
markchien8f831c02019-12-18 17:47:26 +0800172 name: "com.android.tethering.certificate",
173 certificate: "com.android.tethering",
markchien0abdd112019-11-28 10:17:03 +0800174}
markchiendbaff662020-05-05 17:42:44 +0800175
Remi NGUYEN VANe55a88d2022-04-20 15:59:16 +0900176filegroup {
177 name: "connectivity-hiddenapi-files",
Paul Duffinc8164e42022-07-28 10:52:09 +0000178 srcs: [
179 ":connectivity-t-hiddenapi-files",
180 "hiddenapi/*.txt",
181 ],
Remi NGUYEN VANe55a88d2022-04-20 15:59:16 +0900182 visibility: ["//packages/modules/Connectivity:__subpackages__"],
183}
184
satayev8bb425a2021-05-12 13:28:58 +0100185// Encapsulate the contributions made by the com.android.tethering to the bootclasspath.
186bootclasspath_fragment {
187 name: "com.android.tethering-bootclasspath-fragment",
188 contents: [
189 "framework-connectivity",
paulhu699477a2022-02-08 21:25:28 +0800190 "framework-connectivity-t",
satayev8bb425a2021-05-12 13:28:58 +0100191 "framework-tethering",
192 ],
193 apex_available: ["com.android.tethering"],
Paul Duffinb28cb442021-05-26 10:46:20 +0100194
195 // The bootclasspath_fragments that provide APIs on which this depends.
196 fragments: [
197 {
198 apex: "com.android.art",
199 module: "art-bootclasspath-fragment",
200 },
201 ],
202
203 // Additional stubs libraries that this fragment's contents use which are
204 // not provided by another bootclasspath_fragment.
205 additional_stubs: [
206 "android-non-updatable",
207 ],
208
209 // Additional hidden API flag files to override the defaults. This must only be
210 // modified by the Soong or platform compat team.
211 hidden_api: {
Remi NGUYEN VAN955c33c2021-12-16 15:10:40 +0000212 max_target_o_low_priority: [
213 "hiddenapi/hiddenapi-max-target-o-low-priority.txt",
Paul Duffin8be17642022-03-10 17:44:54 +0000214 ],
Junyu Lai2ef865e2022-01-17 11:52:57 +0000215 unsupported: [
216 "hiddenapi/hiddenapi-unsupported.txt",
Junyu Lai2ef865e2022-01-17 11:52:57 +0000217 ],
Paul Duffin8be17642022-03-10 17:44:54 +0000218
219 // The following packages contain classes from other modules on the
220 // bootclasspath. That means that the hidden API flags for this module
221 // has to explicitly list every single class this module provides in
222 // that package to differentiate them from the classes provided by other
223 // modules. That can include private classes that are not part of the
224 // API.
225 split_packages: [
226 "android.app.usage",
227 "android.nearby",
228 "android.net",
Dan Stahre2be25f2023-01-16 18:02:30 +0000229 "android.net.http",
Paul Duffin8be17642022-03-10 17:44:54 +0000230 "android.net.netstats",
231 "android.net.util",
232 ],
233
234 // The following packages and all their subpackages currently only
235 // contain classes from this bootclasspath_fragment. Listing a package
236 // here won't prevent other bootclasspath modules from adding classes in
237 // any of those packages but it will prevent them from adding those
238 // classes into an API surface, e.g. public, system, etc.. Doing so will
239 // result in a build failure due to inconsistent flags.
240 package_prefixes: [
241 "android.nearby.aidl",
242 "android.net.apf",
243 "android.net.connectivity",
Dan Stahre2be25f2023-01-16 18:02:30 +0000244 "android.net.http.apihelpers",
245 "android.net.http.internal",
Paul Duffin8be17642022-03-10 17:44:54 +0000246 "android.net.netstats.provider",
247 "android.net.nsd",
Igor Chernyshev9dac6602022-12-13 19:28:32 -0800248 "android.net.wear",
Paul Duffin8be17642022-03-10 17:44:54 +0000249 ],
Paul Duffinb28cb442021-05-26 10:46:20 +0100250 },
satayev8bb425a2021-05-12 13:28:58 +0100251}
252
Jiakai Zhang9ecc66d2021-12-20 16:54:13 +0000253systemserverclasspath_fragment {
254 name: "com.android.tethering-systemserverclasspath-fragment",
255 standalone_contents: ["service-connectivity"],
256 apex_available: ["com.android.tethering"],
257}
258
markchiendbaff662020-05-05 17:42:44 +0800259override_apex {
260 name: "com.android.tethering.inprocess",
261 base: "com.android.tethering",
262 package_name: "com.android.tethering.inprocess",
Remi NGUYEN VANf24553d2022-01-27 13:16:12 +0900263 enabled: enable_tethering_next_apex,
Maciej Żenczykowskiccce4a32022-07-17 01:28:38 -0700264 bpfs: [
265 "block.o",
266 "clatd.o",
Ken Chen74ff3ee2022-07-14 16:46:39 +0800267 "dscpPolicy.o",
Maciej Żenczykowskiccce4a32022-07-17 01:28:38 -0700268 "netd.o",
269 "offload@inprocess.o",
270 "test@inprocess.o",
271 ],
markchiendbaff662020-05-05 17:42:44 +0800272 apps: [
Remi NGUYEN VANf0f0cca2021-03-12 15:04:29 +0000273 "ServiceConnectivityResources",
markchiendbaff662020-05-05 17:42:44 +0800274 "InProcessTethering",
275 ],
Maciej Żenczykowski760d1ed2022-07-08 05:57:10 -0700276 prebuilts: [
277 "current_sdkinfo",
278 "privapp_allowlist_com.android.tethering",
279 "TetheringInProcessFlag",
280 ],
markchiendbaff662020-05-05 17:42:44 +0800281}