2019-11-28 02:17:03 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2019 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
2021-02-12 22:45:04 +00:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2022-07-08 12:57:10 +00:00
|
|
|
prebuilt_etc {
|
|
|
|
name: "TetheringOutOfProcessFlag",
|
|
|
|
src: "out-of-process",
|
|
|
|
filename_from_src: true,
|
|
|
|
sub_dir: "flag",
|
|
|
|
}
|
|
|
|
|
2021-11-22 02:36:32 +00:00
|
|
|
// Defaults to enable/disable java targets which uses development APIs. "enabled" may have a
|
|
|
|
// different value depending on the branch.
|
|
|
|
java_defaults {
|
|
|
|
name: "ConnectivityNextEnableDefaults",
|
|
|
|
enabled: true,
|
|
|
|
}
|
2023-01-30 10:19:48 +00:00
|
|
|
java_defaults {
|
|
|
|
name: "NetworkStackApiShimSettingsForCurrentBranch",
|
|
|
|
// API shims to include in the networking modules built from the branch. Branches that disable
|
|
|
|
// the "next" targets must use stable shims (latest stable API level) instead of current shims
|
|
|
|
// (X_current API level).
|
|
|
|
static_libs: ["NetworkStackApiCurrentShims"],
|
|
|
|
}
|
2021-11-22 02:36:32 +00:00
|
|
|
apex_defaults {
|
|
|
|
name: "ConnectivityApexDefaults",
|
|
|
|
// Tethering app to include in the AOSP apex. Branches that disable the "next" targets may use
|
|
|
|
// a stable tethering app instead, but will generally override the AOSP apex to use updatable
|
|
|
|
// package names and keys, so that apex will be unused anyway.
|
|
|
|
apps: ["TetheringNext"], // Replace to "Tethering" if ConnectivityNextEnableDefaults is false.
|
|
|
|
}
|
2022-01-27 04:16:12 +00:00
|
|
|
enable_tethering_next_apex = true
|
2021-11-22 02:36:32 +00:00
|
|
|
// This is a placeholder comment to avoid merge conflicts
|
|
|
|
// as the above target may have different "enabled" values
|
|
|
|
// depending on the branch
|
|
|
|
|
2023-01-16 18:02:30 +00:00
|
|
|
apex_defaults {
|
|
|
|
name: "CronetInTetheringApexDefaults",
|
2023-03-15 16:11:52 +00:00
|
|
|
jni_libs: [
|
2023-03-23 12:45:45 +00:00
|
|
|
"cronet_aml_components_cronet_android_cronet",
|
2023-03-15 16:11:52 +00:00
|
|
|
"//external/cronet/third_party/boringssl:libcrypto",
|
|
|
|
"//external/cronet/third_party/boringssl:libssl",
|
|
|
|
],
|
2023-01-16 18:02:30 +00:00
|
|
|
arch: {
|
|
|
|
riscv64: {
|
|
|
|
// TODO: remove this when there is a riscv64 libcronet
|
2023-03-15 16:11:52 +00:00
|
|
|
exclude_jni_libs: [
|
2023-03-23 12:45:45 +00:00
|
|
|
"cronet_aml_components_cronet_android_cronet",
|
2023-03-15 16:11:52 +00:00
|
|
|
"//external/cronet/third_party/boringssl:libcrypto",
|
|
|
|
"//external/cronet/third_party/boringssl:libssl",
|
|
|
|
],
|
2023-01-16 18:02:30 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-11-28 02:17:03 +00:00
|
|
|
apex {
|
2019-12-18 09:47:26 +00:00
|
|
|
name: "com.android.tethering",
|
2022-03-04 15:34:29 +00:00
|
|
|
defaults: [
|
|
|
|
"ConnectivityApexDefaults",
|
2023-01-16 18:02:30 +00:00
|
|
|
"CronetInTetheringApexDefaults",
|
2022-03-04 15:34:29 +00:00
|
|
|
"r-launched-apex-module",
|
|
|
|
],
|
2021-01-13 06:44:38 +00:00
|
|
|
compile_multilib: "both",
|
2021-05-12 12:28:58 +00:00
|
|
|
bootclasspath_fragments: [
|
|
|
|
"com.android.tethering-bootclasspath-fragment",
|
|
|
|
],
|
2021-12-20 16:54:13 +00:00
|
|
|
systemserverclasspath_fragments: [
|
|
|
|
"com.android.tethering-systemserverclasspath-fragment",
|
2021-01-08 01:19:44 +00:00
|
|
|
],
|
2021-01-13 06:44:38 +00:00
|
|
|
multilib: {
|
|
|
|
first: {
|
2021-11-11 09:53:56 +00:00
|
|
|
jni_libs: [
|
|
|
|
"libservice-connectivity",
|
2022-01-31 02:21:08 +00:00
|
|
|
"libandroid_net_connectivity_com_android_net_module_util_jni",
|
2021-11-11 09:53:56 +00:00
|
|
|
],
|
2022-04-04 11:26:16 +00:00
|
|
|
native_shared_libs: [
|
|
|
|
"libcom.android.tethering.connectivity_native",
|
|
|
|
"libnetd_updatable",
|
|
|
|
],
|
2021-01-13 06:44:38 +00:00
|
|
|
},
|
|
|
|
both: {
|
2022-02-02 04:03:29 +00:00
|
|
|
jni_libs: [
|
|
|
|
"libframework-connectivity-jni",
|
|
|
|
"libframework-connectivity-tiramisu-jni"
|
|
|
|
],
|
2021-05-26 09:46:20 +00:00
|
|
|
},
|
2021-01-13 06:44:38 +00:00
|
|
|
},
|
2021-12-16 13:56:02 +00:00
|
|
|
binaries: [
|
|
|
|
"clatd",
|
|
|
|
],
|
2022-01-14 09:42:43 +00:00
|
|
|
canned_fs_config: "canned_fs_config",
|
2021-01-15 04:02:08 +00:00
|
|
|
bpfs: [
|
2021-10-01 20:22:00 +00:00
|
|
|
"block.o",
|
2022-05-02 07:43:51 +00:00
|
|
|
"clatd.o",
|
2022-07-14 08:46:39 +00:00
|
|
|
"dscpPolicy.o",
|
2022-05-02 07:43:51 +00:00
|
|
|
"netd.o",
|
2021-01-15 04:02:08 +00:00
|
|
|
"offload.o",
|
2022-04-23 19:33:32 +00:00
|
|
|
"offload@btf.o",
|
2021-01-15 04:02:08 +00:00
|
|
|
"test.o",
|
2022-04-23 19:33:32 +00:00
|
|
|
"test@btf.o",
|
2021-01-15 04:02:08 +00:00
|
|
|
],
|
2021-03-08 14:09:31 +00:00
|
|
|
apps: [
|
|
|
|
"ServiceConnectivityResources",
|
2022-01-07 04:18:54 +00:00
|
|
|
"HalfSheetUX",
|
2021-03-08 14:09:31 +00:00
|
|
|
],
|
2021-12-03 15:11:27 +00:00
|
|
|
prebuilts: [
|
|
|
|
"current_sdkinfo",
|
|
|
|
"privapp_allowlist_com.android.tethering",
|
2022-07-08 12:57:10 +00:00
|
|
|
"TetheringOutOfProcessFlag",
|
2021-12-03 15:11:27 +00:00
|
|
|
],
|
2019-11-28 02:17:03 +00:00
|
|
|
manifest: "manifest.json",
|
2019-12-18 09:47:26 +00:00
|
|
|
key: "com.android.tethering.key",
|
2021-02-04 01:42:45 +00:00
|
|
|
// Indicates that pre-installed version of this apex can be compressed.
|
|
|
|
// Whether it actually will be compressed is controlled on per-device basis.
|
|
|
|
compressible: true,
|
2019-11-28 02:17:03 +00:00
|
|
|
|
|
|
|
androidManifest: "AndroidManifest.xml",
|
2021-08-02 16:06:35 +00:00
|
|
|
|
2022-07-19 07:33:04 +00:00
|
|
|
compat_configs: [
|
|
|
|
"connectivity-platform-compat-config",
|
|
|
|
],
|
2019-11-28 02:17:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
apex_key {
|
2019-12-18 09:47:26 +00:00
|
|
|
name: "com.android.tethering.key",
|
|
|
|
public_key: "com.android.tethering.avbpubkey",
|
|
|
|
private_key: "com.android.tethering.pem",
|
2019-11-28 02:17:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android_app_certificate {
|
2019-12-18 09:47:26 +00:00
|
|
|
name: "com.android.tethering.certificate",
|
|
|
|
certificate: "com.android.tethering",
|
2019-11-28 02:17:03 +00:00
|
|
|
}
|
2020-05-05 09:42:44 +00:00
|
|
|
|
Use jarjar rule generator for connectivity rules
(This rolls forward part of a previous change, now that jarjar was fixed
to not get very slow when the number of rules increases).
Autogenerate connectivity jarjar rules at build time, to avoid issues
with forgotten jarjar rules or hard-to-diagnose errors introduced by
incorrect rules.
This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.
Notes on implementation:
- connectivity-jarjar-rules now has a subset
framework-connectivity-jarjar-rules containing only the rules
necessary for framework-connectivity. This is necessary because
framework-connectivity cannot depend on rules generated based on
service-connectivity, as there would be a dependency cycle
(service-connectivity depends on framework-connectivity); Soong even
crashes with a stack overflow.
- framework-wifi.stubs.module_lib is added to
framework-connectivity-pre-jarjar as it is necessary to build it (it
is already in impl_only_libs in the defaults).
It is unclear why framework-connectivity-pre-jarjar could build
before that (possibly because it was only used as "lib" ?)
- Fix package-private visibility; for example NattSocketKeepalive,
TcpSocketKeepalive are not API so should be jarjared, but are used
by ConnectivityManager which is not jarjared, so they are not in the
same package after the change. Package-private members in the
former 2 need to be public to be accessible. Changes in this commit
are all that is needed, as demonstrated by followup commits that move
the classes to a different package without further changes, and that
enforce that no class in an API package gets jarjared.
- framework-connectivity-internal-test-defaults is separated from
framework-connectivity-test-defaults, for unit tests that need to
access internal jarjared classes. Such tests need to use the jarjar
rules themselves too, so this is only appropriate for connectivity
internal unit tests.
Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
2022-04-20 06:59:16 +00:00
|
|
|
filegroup {
|
|
|
|
name: "connectivity-hiddenapi-files",
|
2022-07-28 10:52:09 +00:00
|
|
|
srcs: [
|
|
|
|
":connectivity-t-hiddenapi-files",
|
|
|
|
"hiddenapi/*.txt",
|
|
|
|
],
|
Use jarjar rule generator for connectivity rules
(This rolls forward part of a previous change, now that jarjar was fixed
to not get very slow when the number of rules increases).
Autogenerate connectivity jarjar rules at build time, to avoid issues
with forgotten jarjar rules or hard-to-diagnose errors introduced by
incorrect rules.
This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.
Notes on implementation:
- connectivity-jarjar-rules now has a subset
framework-connectivity-jarjar-rules containing only the rules
necessary for framework-connectivity. This is necessary because
framework-connectivity cannot depend on rules generated based on
service-connectivity, as there would be a dependency cycle
(service-connectivity depends on framework-connectivity); Soong even
crashes with a stack overflow.
- framework-wifi.stubs.module_lib is added to
framework-connectivity-pre-jarjar as it is necessary to build it (it
is already in impl_only_libs in the defaults).
It is unclear why framework-connectivity-pre-jarjar could build
before that (possibly because it was only used as "lib" ?)
- Fix package-private visibility; for example NattSocketKeepalive,
TcpSocketKeepalive are not API so should be jarjared, but are used
by ConnectivityManager which is not jarjared, so they are not in the
same package after the change. Package-private members in the
former 2 need to be public to be accessible. Changes in this commit
are all that is needed, as demonstrated by followup commits that move
the classes to a different package without further changes, and that
enforce that no class in an API package gets jarjared.
- framework-connectivity-internal-test-defaults is separated from
framework-connectivity-test-defaults, for unit tests that need to
access internal jarjared classes. Such tests need to use the jarjar
rules themselves too, so this is only appropriate for connectivity
internal unit tests.
Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
2022-04-20 06:59:16 +00:00
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
|
|
|
}
|
|
|
|
|
2021-05-12 12:28:58 +00:00
|
|
|
// Encapsulate the contributions made by the com.android.tethering to the bootclasspath.
|
|
|
|
bootclasspath_fragment {
|
|
|
|
name: "com.android.tethering-bootclasspath-fragment",
|
|
|
|
contents: [
|
|
|
|
"framework-connectivity",
|
2022-02-08 13:25:28 +00:00
|
|
|
"framework-connectivity-t",
|
2021-05-12 12:28:58 +00:00
|
|
|
"framework-tethering",
|
|
|
|
],
|
|
|
|
apex_available: ["com.android.tethering"],
|
2021-05-26 09:46:20 +00:00
|
|
|
|
|
|
|
// The bootclasspath_fragments that provide APIs on which this depends.
|
|
|
|
fragments: [
|
|
|
|
{
|
|
|
|
apex: "com.android.art",
|
|
|
|
module: "art-bootclasspath-fragment",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
// Additional stubs libraries that this fragment's contents use which are
|
|
|
|
// not provided by another bootclasspath_fragment.
|
|
|
|
additional_stubs: [
|
|
|
|
"android-non-updatable",
|
|
|
|
],
|
|
|
|
|
|
|
|
// Additional hidden API flag files to override the defaults. This must only be
|
|
|
|
// modified by the Soong or platform compat team.
|
|
|
|
hidden_api: {
|
2021-12-16 15:10:40 +00:00
|
|
|
max_target_o_low_priority: [
|
|
|
|
"hiddenapi/hiddenapi-max-target-o-low-priority.txt",
|
2022-03-10 17:44:54 +00:00
|
|
|
],
|
2022-01-17 11:52:57 +00:00
|
|
|
unsupported: [
|
|
|
|
"hiddenapi/hiddenapi-unsupported.txt",
|
|
|
|
],
|
2022-03-10 17:44:54 +00:00
|
|
|
|
|
|
|
// The following packages contain classes from other modules on the
|
|
|
|
// bootclasspath. That means that the hidden API flags for this module
|
|
|
|
// has to explicitly list every single class this module provides in
|
|
|
|
// that package to differentiate them from the classes provided by other
|
|
|
|
// modules. That can include private classes that are not part of the
|
|
|
|
// API.
|
|
|
|
split_packages: [
|
|
|
|
"android.app.usage",
|
|
|
|
"android.nearby",
|
|
|
|
"android.net",
|
2023-01-16 18:02:30 +00:00
|
|
|
"android.net.http",
|
2022-03-10 17:44:54 +00:00
|
|
|
"android.net.netstats",
|
|
|
|
"android.net.util",
|
|
|
|
],
|
|
|
|
|
|
|
|
// The following packages and all their subpackages currently only
|
|
|
|
// contain classes from this bootclasspath_fragment. Listing a package
|
|
|
|
// here won't prevent other bootclasspath modules from adding classes in
|
|
|
|
// any of those packages but it will prevent them from adding those
|
|
|
|
// classes into an API surface, e.g. public, system, etc.. Doing so will
|
|
|
|
// result in a build failure due to inconsistent flags.
|
|
|
|
package_prefixes: [
|
|
|
|
"android.nearby.aidl",
|
|
|
|
"android.net.apf",
|
|
|
|
"android.net.connectivity",
|
2023-01-16 18:02:30 +00:00
|
|
|
"android.net.http.apihelpers",
|
2022-03-10 17:44:54 +00:00
|
|
|
"android.net.netstats.provider",
|
|
|
|
"android.net.nsd",
|
2022-12-14 03:28:32 +00:00
|
|
|
"android.net.wear",
|
2022-03-10 17:44:54 +00:00
|
|
|
],
|
2021-05-26 09:46:20 +00:00
|
|
|
},
|
2021-05-12 12:28:58 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 16:54:13 +00:00
|
|
|
systemserverclasspath_fragment {
|
|
|
|
name: "com.android.tethering-systemserverclasspath-fragment",
|
|
|
|
standalone_contents: ["service-connectivity"],
|
|
|
|
apex_available: ["com.android.tethering"],
|
|
|
|
}
|