2021-01-15 16:22:36 +09:00
|
|
|
//
|
|
|
|
|
// Copyright (C) 2020 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 17:07:05 -08:00
|
|
|
package {
|
|
|
|
|
// See: http://go/android-license-faq
|
2021-05-24 03:50:01 +00:00
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
2021-02-12 17:07:05 -08:00
|
|
|
}
|
|
|
|
|
|
2021-01-15 16:22:36 +09:00
|
|
|
filegroup {
|
2021-02-15 20:16:28 +09:00
|
|
|
name: "framework-connectivity-internal-sources",
|
2021-01-15 16:22:36 +09:00
|
|
|
srcs: [
|
|
|
|
|
"src/**/*.java",
|
|
|
|
|
"src/**/*.aidl",
|
|
|
|
|
],
|
|
|
|
|
path: "src",
|
2021-02-15 20:16:28 +09:00
|
|
|
visibility: [
|
|
|
|
|
"//visibility:private",
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "framework-connectivity-aidl-export-sources",
|
|
|
|
|
srcs: [
|
|
|
|
|
"aidl-export/**/*.aidl",
|
|
|
|
|
],
|
|
|
|
|
path: "aidl-export",
|
|
|
|
|
visibility: [
|
|
|
|
|
"//visibility:private",
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: use a java_library in the bootclasspath instead
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "framework-connectivity-sources",
|
2023-03-15 10:30:10 +00:00
|
|
|
defaults: ["framework-sources-module-defaults"],
|
2021-02-15 20:16:28 +09:00
|
|
|
srcs: [
|
|
|
|
|
":framework-connectivity-internal-sources",
|
|
|
|
|
":framework-connectivity-aidl-export-sources",
|
|
|
|
|
],
|
2023-03-15 10:30:10 +00:00
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
2021-02-12 17:07:05 -08:00
|
|
|
}
|
2021-01-28 13:37:03 +09:00
|
|
|
|
2022-01-31 11:21:08 +09:00
|
|
|
java_defaults {
|
|
|
|
|
name: "framework-connectivity-defaults",
|
|
|
|
|
defaults: ["framework-module-defaults"],
|
2021-03-24 22:59:50 +09:00
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
2021-01-28 13:37:03 +09:00
|
|
|
srcs: [
|
|
|
|
|
":framework-connectivity-sources",
|
2021-03-24 22:59:50 +09:00
|
|
|
":net-utils-framework-common-srcs",
|
2022-01-17 11:52:57 +00:00
|
|
|
":framework-connectivity-api-shared-srcs",
|
2021-01-28 13:37:03 +09:00
|
|
|
],
|
|
|
|
|
aidl: {
|
2021-12-13 15:52:07 +00:00
|
|
|
generate_get_transaction_name: true,
|
2021-01-28 13:37:03 +09:00
|
|
|
include_dirs: [
|
|
|
|
|
// Include directories for parcelables that are part of the stable API, and need a
|
|
|
|
|
// one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
|
|
|
|
|
// TODO(b/180293679): remove these dependencies as they should not be necessary once
|
|
|
|
|
// the module builds against API (the parcelable declarations exist in framework.aidl)
|
|
|
|
|
"frameworks/base/core/java", // For framework parcelables
|
|
|
|
|
"frameworks/native/aidl/binder", // For PersistableBundle.aidl
|
|
|
|
|
],
|
|
|
|
|
},
|
2022-01-31 11:21:08 +09:00
|
|
|
stub_only_libs: [
|
2022-02-08 21:25:28 +08:00
|
|
|
"framework-connectivity-t.stubs.module_lib",
|
2022-01-31 11:21:08 +09:00
|
|
|
],
|
2021-03-24 22:59:50 +09:00
|
|
|
impl_only_libs: [
|
2022-12-13 19:28:32 -08:00
|
|
|
// TODO: figure out why just using "framework-tethering" uses the stubs, even though both
|
|
|
|
|
// framework-connectivity and framework-tethering are in the same APEX.
|
2023-07-25 23:02:43 +00:00
|
|
|
"framework-location.stubs.module_lib",
|
2022-12-13 19:28:32 -08:00
|
|
|
"framework-tethering.impl",
|
2021-03-24 22:59:50 +09:00
|
|
|
"framework-wifi.stubs.module_lib",
|
|
|
|
|
],
|
2021-11-15 18:17:33 +09:00
|
|
|
static_libs: [
|
2023-11-17 12:20:53 +08:00
|
|
|
// Not using the latest stable version because all functions in the latest version of
|
|
|
|
|
// mdns_aidl_interface are deprecated.
|
|
|
|
|
"mdns_aidl_interface-V1-java",
|
2022-01-23 16:14:51 +00:00
|
|
|
"modules-utils-backgroundthread",
|
2021-11-15 18:17:33 +09:00
|
|
|
"modules-utils-build",
|
2022-01-31 11:21:08 +09:00
|
|
|
"modules-utils-preconditions",
|
2022-06-08 01:25:14 -04:00
|
|
|
"framework-connectivity-javastream-protos",
|
2021-11-15 18:17:33 +09:00
|
|
|
],
|
2023-08-23 17:35:17 +08:00
|
|
|
impl_only_static_libs: [
|
2023-08-28 18:49:44 +08:00
|
|
|
"net-utils-device-common-bpf",
|
2023-08-23 17:35:17 +08:00
|
|
|
],
|
2021-01-28 13:37:03 +09:00
|
|
|
libs: [
|
2022-06-24 19:16:40 +09:00
|
|
|
"androidx.annotation_annotation",
|
2021-08-02 18:06:35 +02:00
|
|
|
"app-compat-annotations",
|
2022-02-08 21:25:28 +08:00
|
|
|
"framework-connectivity-t.stubs.module_lib",
|
2021-01-28 13:37:03 +09:00
|
|
|
"unsupportedappusage",
|
|
|
|
|
],
|
2022-01-31 11:21:08 +09:00
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
],
|
2023-12-20 11:57:07 -08:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
},
|
2022-01-31 11:21:08 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "framework-connectivity-pre-jarjar",
|
2023-04-14 19:22:42 +09:00
|
|
|
defaults: [
|
|
|
|
|
"framework-connectivity-defaults",
|
2023-05-11 13:28:54 -07:00
|
|
|
],
|
|
|
|
|
static_libs: [
|
2023-07-17 14:52:16 +00:00
|
|
|
"httpclient_api",
|
|
|
|
|
"httpclient_impl",
|
2023-06-29 18:08:39 +01:00
|
|
|
"http_client_logging",
|
2023-08-23 17:35:17 +08:00
|
|
|
// Framework-connectivity-pre-jarjar is identical to framework-connectivity
|
|
|
|
|
// implementation, but without the jarjar rules. However, framework-connectivity
|
|
|
|
|
// is not based on framework-connectivity-pre-jarjar, it's rebuilt from source
|
|
|
|
|
// to generate the SDK stubs.
|
|
|
|
|
// Even if the library is included in "impl_only_static_libs" of defaults. This is still
|
|
|
|
|
// needed because java_library which doesn't understand "impl_only_static_libs".
|
2023-08-28 18:49:44 +08:00
|
|
|
"net-utils-device-common-bpf",
|
2023-05-11 13:28:54 -07:00
|
|
|
],
|
2022-01-31 11:21:08 +09:00
|
|
|
libs: [
|
|
|
|
|
// This cannot be in the defaults clause above because if it were, it would be used
|
|
|
|
|
// to generate the connectivity stubs. That would create a circular dependency
|
2022-12-13 19:28:32 -08:00
|
|
|
// because the tethering impl depend on the connectivity stubs (e.g.,
|
2022-01-31 11:21:08 +09:00
|
|
|
// TetheringRequest depends on LinkAddress).
|
2023-07-25 23:02:43 +00:00
|
|
|
"framework-location.stubs.module_lib",
|
2022-12-13 19:28:32 -08:00
|
|
|
"framework-tethering.impl",
|
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
|
|
|
"framework-wifi.stubs.module_lib",
|
2022-01-31 11:21:08 +09:00
|
|
|
],
|
2023-12-20 11:57:07 -08:00
|
|
|
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
|
|
|
|
lint: {
|
|
|
|
|
baseline_filename: "lint-baseline.xml",
|
|
|
|
|
},
|
2022-01-31 11:21:08 +09:00
|
|
|
}
|
|
|
|
|
|
2023-05-11 13:28:54 -07:00
|
|
|
java_defaults {
|
|
|
|
|
name: "CronetJavaDefaults",
|
2023-07-17 14:52:16 +00:00
|
|
|
srcs: [":httpclient_api_sources"],
|
2023-05-11 13:28:54 -07:00
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
],
|
|
|
|
|
impl_only_static_libs: [
|
2023-07-17 14:52:16 +00:00
|
|
|
"httpclient_impl",
|
2023-06-29 18:08:39 +01:00
|
|
|
"http_client_logging",
|
2023-05-11 13:28:54 -07:00
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-31 11:21:08 +09:00
|
|
|
java_sdk_library {
|
|
|
|
|
name: "framework-connectivity",
|
2023-04-14 19:22:42 +09:00
|
|
|
defaults: [
|
|
|
|
|
"framework-connectivity-defaults",
|
|
|
|
|
"CronetJavaDefaults",
|
|
|
|
|
],
|
2022-01-31 11:21:08 +09:00
|
|
|
installable: true,
|
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",
|
2021-03-19 10:13:40 +00:00
|
|
|
permitted_packages: ["android.net"],
|
2021-03-24 22:59:50 +09:00
|
|
|
impl_library_visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/Tethering/apex",
|
|
|
|
|
// In preparation for future move
|
|
|
|
|
"//packages/modules/Connectivity/apex",
|
2022-01-31 11:21:08 +09:00
|
|
|
"//packages/modules/Connectivity/framework-t",
|
2021-03-24 22:59:50 +09:00
|
|
|
"//packages/modules/Connectivity/service",
|
2021-12-14 01:30:22 +00:00
|
|
|
"//packages/modules/Connectivity/service-t",
|
2021-03-24 22:59:50 +09:00
|
|
|
"//frameworks/base/packages/Connectivity/service",
|
|
|
|
|
"//frameworks/base",
|
2021-03-16 01:31:07 +00:00
|
|
|
|
|
|
|
|
// Tests using hidden APIs
|
2021-04-14 11:48:19 +08:00
|
|
|
"//cts/tests/netlegacy22.api",
|
2022-02-01 13:51:42 +09:00
|
|
|
"//cts/tests/tests/app.usage", // NetworkUsageStatsTest
|
2021-03-16 01:31:07 +00:00
|
|
|
"//external/sl4a:__subpackages__",
|
2021-05-11 13:37:06 +00:00
|
|
|
"//frameworks/base/packages/Connectivity/tests:__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",
|
2022-01-23 16:14:51 +00:00
|
|
|
"//frameworks/opt/net/ethernet/tests:__subpackages__",
|
2021-03-16 01:31:07 +00:00
|
|
|
"//frameworks/opt/telephony/tests/telephonytests",
|
2021-04-13 11:15:36 +08:00
|
|
|
"//packages/modules/CaptivePortalLogin/tests",
|
2023-09-11 11:48:36 +09:00
|
|
|
"//packages/modules/Connectivity/staticlibs/testutils",
|
|
|
|
|
"//packages/modules/Connectivity/staticlibs/tests:__subpackages__",
|
2023-04-14 19:22:42 +09:00
|
|
|
"//packages/modules/Connectivity/Cronet/tests:__subpackages__",
|
2021-03-16 01:31:07 +00:00
|
|
|
"//packages/modules/Connectivity/Tethering/tests:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/tests:__subpackages__",
|
2022-01-26 00:43:10 +08:00
|
|
|
"//packages/modules/IPsec/tests/iketests",
|
2021-03-16 01:31:07 +00:00
|
|
|
"//packages/modules/NetworkStack/tests:__subpackages__",
|
2021-03-31 16:11:37 +08:00
|
|
|
"//packages/modules/Wifi/service/tests/wifitests",
|
2021-03-24 22:59:50 +09:00
|
|
|
],
|
2023-12-20 11:57:07 -08:00
|
|
|
lint: {
|
|
|
|
|
baseline_filename: "lint-baseline.xml",
|
|
|
|
|
},
|
2021-03-19 10:13:40 +00:00
|
|
|
}
|
|
|
|
|
|
2021-08-02 18:06:35 +02:00
|
|
|
platform_compat_config {
|
|
|
|
|
name: "connectivity-platform-compat-config",
|
|
|
|
|
src: ":framework-connectivity",
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-02 06:38:46 +00:00
|
|
|
cc_library_shared {
|
|
|
|
|
name: "libframework-connectivity-jni",
|
|
|
|
|
min_sdk_version: "30",
|
2021-03-19 10:13:40 +00:00
|
|
|
cflags: [
|
|
|
|
|
"-Wall",
|
|
|
|
|
"-Werror",
|
|
|
|
|
"-Wno-unused-parameter",
|
2021-03-23 14:45:58 +00:00
|
|
|
// Don't warn about S API usage even with
|
|
|
|
|
// min_sdk 30: the library is only loaded
|
|
|
|
|
// on S+ devices
|
|
|
|
|
"-Wno-unguarded-availability",
|
2021-03-19 10:13:40 +00:00
|
|
|
"-Wthread-safety",
|
|
|
|
|
],
|
2021-04-02 06:38:46 +00:00
|
|
|
srcs: [
|
|
|
|
|
"jni/android_net_NetworkUtils.cpp",
|
|
|
|
|
"jni/onload.cpp",
|
|
|
|
|
],
|
2021-03-19 10:13:40 +00:00
|
|
|
shared_libs: [
|
2021-04-02 06:38:46 +00:00
|
|
|
"libandroid",
|
2021-03-19 10:13:40 +00:00
|
|
|
"liblog",
|
|
|
|
|
"libnativehelper",
|
|
|
|
|
],
|
|
|
|
|
header_libs: [
|
2023-03-11 01:19:40 +00:00
|
|
|
"bpf_headers",
|
2021-03-19 10:13:40 +00:00
|
|
|
"dnsproxyd_protocol_headers",
|
|
|
|
|
],
|
2021-04-02 06:38:46 +00:00
|
|
|
stl: "none",
|
2021-03-19 10:13:40 +00:00
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
2021-03-19 00:24:45 +00:00
|
|
|
],
|
2021-01-28 13:37:03 +09:00
|
|
|
}
|
2022-01-17 11:52:57 +00:00
|
|
|
|
2022-02-14 21:38:14 +08:00
|
|
|
filegroup {
|
2022-01-17 11:52:57 +00:00
|
|
|
name: "framework-connectivity-protos",
|
|
|
|
|
srcs: [
|
2022-02-14 21:38:14 +08:00
|
|
|
"proto/**/*.proto",
|
2022-01-17 11:52:57 +00:00
|
|
|
],
|
2022-02-14 21:38:14 +08:00
|
|
|
visibility: ["//frameworks/base"],
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-08 01:25:14 -04:00
|
|
|
java_library {
|
2022-02-14 21:38:14 +08:00
|
|
|
name: "framework-connectivity-javastream-protos",
|
2022-06-08 01:25:14 -04:00
|
|
|
proto: {
|
|
|
|
|
type: "stream",
|
|
|
|
|
},
|
|
|
|
|
srcs: [":framework-connectivity-protos"],
|
|
|
|
|
installable: false,
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
2022-01-17 11:52:57 +00:00
|
|
|
],
|
2023-12-20 11:57:07 -08:00
|
|
|
lint: {
|
|
|
|
|
baseline_filename: "lint-baseline.xml",
|
|
|
|
|
},
|
2022-01-17 11:52:57 +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 15:59:16 +09:00
|
|
|
|
|
|
|
|
java_genrule {
|
|
|
|
|
name: "framework-connectivity-jarjar-rules",
|
|
|
|
|
tool_files: [
|
|
|
|
|
":connectivity-hiddenapi-files",
|
|
|
|
|
":framework-connectivity-pre-jarjar{.jar}",
|
|
|
|
|
":framework-connectivity-t-pre-jarjar{.jar}",
|
|
|
|
|
":framework-connectivity.stubs.module_lib{.jar}",
|
|
|
|
|
":framework-connectivity-t.stubs.module_lib{.jar}",
|
2023-11-22 16:24:32 +09:00
|
|
|
":framework-connectivity-module-api-stubs-including-flagged{.jar}",
|
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-excludes.txt",
|
|
|
|
|
],
|
|
|
|
|
tools: [
|
|
|
|
|
"jarjar-rules-generator",
|
|
|
|
|
],
|
|
|
|
|
out: ["framework_connectivity_jarjar_rules.txt"],
|
|
|
|
|
cmd: "$(location jarjar-rules-generator) " +
|
2022-08-10 20:15:46 +09:00
|
|
|
"$(location :framework-connectivity-pre-jarjar{.jar}) " +
|
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
|
|
|
"$(location :framework-connectivity-t-pre-jarjar{.jar}) " +
|
|
|
|
|
"--prefix android.net.connectivity " +
|
|
|
|
|
"--apistubs $(location :framework-connectivity.stubs.module_lib{.jar}) " +
|
2022-08-10 20:15:46 +09:00
|
|
|
"--apistubs $(location :framework-connectivity-t.stubs.module_lib{.jar}) " +
|
2023-11-22 16:24:32 +09:00
|
|
|
"--apistubs $(location :framework-connectivity-module-api-stubs-including-flagged{.jar}) " +
|
2022-08-10 20:15:46 +09:00
|
|
|
// Make a ":"-separated list. There will be an extra ":" but empty items are ignored.
|
|
|
|
|
"--unsupportedapi $$(printf ':%s' $(locations :connectivity-hiddenapi-files)) " +
|
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
|
|
|
"--excludes $(location jarjar-excludes.txt) " +
|
|
|
|
|
"--output $(out)",
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/framework:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/framework-t:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/service",
|
|
|
|
|
],
|
|
|
|
|
}
|
2022-12-13 19:28:32 -08:00
|
|
|
|
2023-11-06 22:49:25 +09:00
|
|
|
droidstubs {
|
2023-11-22 16:24:32 +09:00
|
|
|
name: "framework-connectivity-module-api-stubs-including-flagged-droidstubs",
|
2023-11-06 22:49:25 +09:00
|
|
|
srcs: [
|
|
|
|
|
":framework-connectivity-sources",
|
|
|
|
|
":framework-connectivity-tiramisu-updatable-sources",
|
|
|
|
|
":framework-nearby-java-sources",
|
|
|
|
|
":framework-thread-sources",
|
|
|
|
|
],
|
|
|
|
|
flags: [
|
2023-11-09 16:34:07 +09:00
|
|
|
"--show-for-stub-purposes-annotation android.annotation.SystemApi" +
|
2023-12-20 11:57:07 -08:00
|
|
|
"\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\)",
|
2023-11-09 16:34:07 +09:00
|
|
|
"--show-for-stub-purposes-annotation android.annotation.SystemApi" +
|
2023-12-20 11:57:07 -08:00
|
|
|
"\\(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES\\)",
|
2023-11-06 22:49:25 +09:00
|
|
|
],
|
|
|
|
|
aidl: {
|
|
|
|
|
include_dirs: [
|
|
|
|
|
"packages/modules/Connectivity/framework/aidl-export",
|
|
|
|
|
"frameworks/native/aidl/binder", // For PersistableBundle.aidl
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_library {
|
2023-11-22 16:24:32 +09:00
|
|
|
name: "framework-connectivity-module-api-stubs-including-flagged",
|
|
|
|
|
srcs: [":framework-connectivity-module-api-stubs-including-flagged-droidstubs"],
|
2023-12-20 11:57:07 -08:00
|
|
|
lint: {
|
|
|
|
|
baseline_filename: "lint-baseline.xml",
|
|
|
|
|
},
|
2023-11-06 22:49:25 +09:00
|
|
|
}
|
|
|
|
|
|
2022-12-13 19:28:32 -08:00
|
|
|
// Library providing limited APIs within the connectivity module, so that R+ components like
|
|
|
|
|
// Tethering have a controlled way to depend on newer components like framework-connectivity that
|
|
|
|
|
// are not loaded on R.
|
2023-08-25 12:50:37 +09:00
|
|
|
// Note that this target needs to have access to hidden classes, and as such needs to list
|
|
|
|
|
// the full libraries instead of the .impl lib (which only expose API classes).
|
2022-12-13 19:28:32 -08:00
|
|
|
java_library {
|
|
|
|
|
name: "connectivity-internal-api-util",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
2023-08-25 12:50:37 +09:00
|
|
|
"framework-connectivity-pre-jarjar",
|
2022-12-13 19:28:32 -08:00
|
|
|
],
|
|
|
|
|
jarjar_rules: ":framework-connectivity-jarjar-rules",
|
|
|
|
|
srcs: [
|
2023-08-25 12:50:37 +09:00
|
|
|
// Files listed here MUST all be annotated with @RequiresApi(Build.VERSION_CODES.S)
|
|
|
|
|
// or above as appropriate so that API checks are enforced for R+ users of this library
|
|
|
|
|
"src/android/net/RoutingCoordinatorManager.java",
|
2023-10-24 20:59:01 +09:00
|
|
|
"src/android/net/connectivity/ConnectivityInternalApiUtil.java",
|
2022-12-13 19:28:32 -08:00
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/Tethering:__subpackages__",
|
|
|
|
|
],
|
2023-12-20 11:57:07 -08:00
|
|
|
lint: {
|
|
|
|
|
baseline_filename: "lint-baseline.xml",
|
|
|
|
|
},
|
2022-12-13 19:28:32 -08:00
|
|
|
}
|