2021-12-14 01:30:22 +00:00
|
|
|
//
|
|
|
|
|
// Copyright (C) 2021 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.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
package {
|
|
|
|
|
// See: http://go/android-license-faq
|
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-08 19:49:49 +09:00
|
|
|
// Include build rules from Sources.bp
|
|
|
|
|
build = ["Sources.bp"]
|
|
|
|
|
|
2021-12-16 15:10:40 +00:00
|
|
|
java_defaults {
|
|
|
|
|
name: "enable-framework-connectivity-t-targets",
|
|
|
|
|
enabled: true,
|
|
|
|
|
}
|
|
|
|
|
// The above defaults can be used to disable framework-connectivity t
|
|
|
|
|
// targets while minimizing merge conflicts in the build rules.
|
|
|
|
|
|
2022-01-31 11:21:08 +09:00
|
|
|
// SDK library for connectivity bootclasspath classes that were part of the non-updatable API before
|
|
|
|
|
// T, and were moved to the module in T. Other bootclasspath classes in connectivity should go to
|
|
|
|
|
// framework-connectivity.
|
2022-02-01 23:07:33 +09:00
|
|
|
java_defaults {
|
2022-02-08 21:25:28 +08:00
|
|
|
name: "framework-connectivity-t-defaults",
|
2021-12-14 01:30:22 +00:00
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "Tiramisu",
|
2021-12-16 15:10:40 +00:00
|
|
|
defaults: [
|
|
|
|
|
"framework-module-defaults",
|
|
|
|
|
],
|
2021-12-14 01:30:22 +00:00
|
|
|
srcs: [
|
|
|
|
|
":framework-connectivity-tiramisu-updatable-sources",
|
2022-01-07 13:18:54 +09:00
|
|
|
":framework-nearby-java-sources",
|
2023-08-11 15:30:09 +08:00
|
|
|
":framework-thread-sources",
|
2023-08-08 04:28:45 +00:00
|
|
|
":framework-remoteauth-java-sources",
|
2022-01-07 13:18:54 +09:00
|
|
|
],
|
2021-12-14 01:30:22 +00:00
|
|
|
libs: [
|
|
|
|
|
"unsupportedappusage",
|
|
|
|
|
"app-compat-annotations",
|
2023-03-22 19:06:54 +00:00
|
|
|
"androidx.annotation_annotation",
|
2022-01-31 11:21:08 +09:00
|
|
|
],
|
|
|
|
|
impl_only_libs: [
|
|
|
|
|
// The build system will use framework-bluetooth module_current stubs, because
|
|
|
|
|
// of sdk_version: "module_current" above.
|
2022-01-07 13:18:54 +09:00
|
|
|
"framework-bluetooth",
|
2022-01-17 11:52:57 +00:00
|
|
|
"framework-wifi",
|
2022-01-31 11:21:08 +09:00
|
|
|
// Compile against the entire implementation of framework-connectivity,
|
|
|
|
|
// including hidden methods. This is safe because if framework-connectivity-t is
|
|
|
|
|
// on the bootclasspath (i.e., T), then framework-connectivity is also on the
|
|
|
|
|
// bootclasspath (because it shipped in S).
|
|
|
|
|
//
|
|
|
|
|
// This compiles against the pre-jarjar target so that this code can use
|
|
|
|
|
// non-jarjard names of widely-used packages such as com.android.net.module.util.
|
|
|
|
|
"framework-connectivity-pre-jarjar",
|
2021-12-14 01:30:22 +00:00
|
|
|
],
|
2022-01-13 06:43:37 +00:00
|
|
|
aidl: {
|
|
|
|
|
generate_get_transaction_name: true,
|
|
|
|
|
include_dirs: [
|
|
|
|
|
// For connectivity-framework classes such as Network.aidl,
|
|
|
|
|
// and connectivity-framework-t classes such as
|
|
|
|
|
// NetworkStateSnapshot.aidl
|
|
|
|
|
"packages/modules/Connectivity/framework/aidl-export",
|
|
|
|
|
],
|
|
|
|
|
},
|
2022-02-01 23:07:33 +09:00
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-28 10:52:09 +00:00
|
|
|
filegroup {
|
|
|
|
|
name: "connectivity-t-hiddenapi-files",
|
|
|
|
|
srcs: ["hiddenapi/*.txt"],
|
|
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-14 22:59:37 +09:00
|
|
|
// The filegroup lists files that are necessary for verifying building mdns as a standalone,
|
|
|
|
|
// for use with service-connectivity-mdns-standalone-build-test
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "framework-connectivity-t-mdns-standalone-build-sources",
|
|
|
|
|
srcs: [
|
|
|
|
|
"src/android/net/nsd/OffloadEngine.java",
|
|
|
|
|
"src/android/net/nsd/OffloadServiceInfo.java",
|
|
|
|
|
],
|
|
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-01 23:07:33 +09:00
|
|
|
java_library {
|
2022-02-08 21:25:28 +08:00
|
|
|
name: "framework-connectivity-t-pre-jarjar",
|
|
|
|
|
defaults: ["framework-connectivity-t-defaults"],
|
2022-02-01 23:07:33 +09:00
|
|
|
libs: [
|
|
|
|
|
"framework-bluetooth",
|
2022-01-17 11:52:57 +00:00
|
|
|
"framework-wifi",
|
2022-02-01 23:07:33 +09:00
|
|
|
"framework-connectivity-pre-jarjar",
|
|
|
|
|
],
|
|
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SDK library for connectivity bootclasspath classes that were part of the non-updatable API before
|
|
|
|
|
// T, and were moved to the module in T. Other bootclasspath classes in connectivity should go to
|
|
|
|
|
// framework-connectivity.
|
|
|
|
|
java_sdk_library {
|
2022-02-08 21:25:28 +08:00
|
|
|
name: "framework-connectivity-t",
|
2022-02-01 23:07:33 +09:00
|
|
|
defaults: [
|
2022-02-08 21:25:28 +08:00
|
|
|
"framework-connectivity-t-defaults",
|
2022-02-09 18:21:56 +08:00
|
|
|
"enable-framework-connectivity-t-targets",
|
2022-02-01 23:07:33 +09:00
|
|
|
],
|
|
|
|
|
// Do not add static_libs to this library: put them in framework-connectivity instead.
|
|
|
|
|
// The jarjar rules are only so that references to jarjared utils in
|
|
|
|
|
// framework-connectivity-pre-jarjar match at runtime.
|
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 15:59:16 +09:00
|
|
|
jarjar_rules: ":framework-connectivity-jarjar-rules",
|
2022-08-03 15:31:02 +09:00
|
|
|
stub_only_libs: [
|
|
|
|
|
// Use prebuilt framework-connectivity stubs to avoid circular dependencies
|
|
|
|
|
"sdk_module-lib_current_framework-connectivity",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"sdk_module-lib_current_framework-connectivity",
|
|
|
|
|
],
|
2021-12-14 01:30:22 +00:00
|
|
|
permitted_packages: [
|
2022-01-17 11:52:57 +00:00
|
|
|
"android.app.usage",
|
2021-12-14 01:30:22 +00:00
|
|
|
"android.net",
|
|
|
|
|
"android.net.nsd",
|
2022-01-07 13:18:54 +09:00
|
|
|
"android.nearby",
|
2023-08-08 04:28:45 +00:00
|
|
|
"android.remoteauth",
|
2022-01-07 13:18:54 +09:00
|
|
|
"com.android.connectivity",
|
|
|
|
|
"com.android.nearby",
|
2023-08-08 04:28:45 +00:00
|
|
|
"com.android.remoteauth",
|
2021-12-14 01:30:22 +00:00
|
|
|
],
|
2022-07-28 10:52:09 +00:00
|
|
|
|
|
|
|
|
hidden_api: {
|
|
|
|
|
max_target_o_low_priority: [
|
|
|
|
|
"hiddenapi/hiddenapi-max-target-o-low-priority-tiramisu.txt",
|
|
|
|
|
],
|
|
|
|
|
max_target_r_low_priority: [
|
|
|
|
|
"hiddenapi/hiddenapi-max-target-r-loprio.txt",
|
|
|
|
|
],
|
|
|
|
|
unsupported: [
|
|
|
|
|
"hiddenapi/hiddenapi-unsupported-tiramisu.txt",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
2021-12-14 01:30:22 +00:00
|
|
|
impl_library_visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/Tethering/apex",
|
|
|
|
|
// In preparation for future move
|
|
|
|
|
"//packages/modules/Connectivity/apex",
|
2022-07-25 18:52:58 +09:00
|
|
|
"//packages/modules/Connectivity/service", // For R8 only
|
2021-12-14 01:30:22 +00:00
|
|
|
"//packages/modules/Connectivity/service-t",
|
2023-03-22 14:19:02 -07:00
|
|
|
"//packages/modules/Connectivity/nearby:__subpackages__",
|
2023-08-08 04:28:45 +00:00
|
|
|
"//packages/modules/Connectivity/remoteauth:__subpackages__",
|
2021-12-14 01:30:22 +00:00
|
|
|
"//frameworks/base",
|
|
|
|
|
|
|
|
|
|
// Tests using hidden APIs
|
|
|
|
|
"//cts/tests/netlegacy22.api",
|
2022-02-01 13:51:42 +09:00
|
|
|
"//cts/tests/tests/app.usage", // NetworkUsageStatsTest
|
2021-12-14 01:30:22 +00:00
|
|
|
"//external/sl4a:__subpackages__",
|
2022-02-02 20:06:56 +09:00
|
|
|
"//frameworks/base/core/tests/bandwidthtests",
|
|
|
|
|
"//frameworks/base/core/tests/benchmarks",
|
|
|
|
|
"//frameworks/base/core/tests/utillib",
|
2022-01-26 00:43:10 +08:00
|
|
|
"//frameworks/base/tests/vcn",
|
2021-12-14 01:30:22 +00:00
|
|
|
"//frameworks/libs/net/common/testutils",
|
|
|
|
|
"//frameworks/libs/net/common/tests:__subpackages__",
|
2022-01-23 16:14:51 +00:00
|
|
|
"//frameworks/opt/net/ethernet/tests:__subpackages__",
|
2021-12-14 01:30:22 +00:00
|
|
|
"//frameworks/opt/telephony/tests/telephonytests",
|
|
|
|
|
"//packages/modules/CaptivePortalLogin/tests",
|
|
|
|
|
"//packages/modules/Connectivity/Tethering/tests:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/tests:__subpackages__",
|
2022-02-11 13:52:29 +08:00
|
|
|
"//packages/modules/IPsec/tests/iketests",
|
2021-12-14 01:30:22 +00:00
|
|
|
"//packages/modules/NetworkStack/tests:__subpackages__",
|
|
|
|
|
"//packages/modules/Wifi/service/tests/wifitests",
|
|
|
|
|
],
|
|
|
|
|
}
|
2022-07-19 16:33:04 +09:00
|
|
|
|
2023-02-09 16:29:16 +09:00
|
|
|
// This rule is not used anymore(b/268440216).
|
2022-07-19 16:33:04 +09:00
|
|
|
platform_compat_config {
|
|
|
|
|
name: "connectivity-t-platform-compat-config",
|
|
|
|
|
src: ":framework-connectivity-t",
|
|
|
|
|
}
|