Use current shims in service-connectivity

Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
as this is a development branch.

Use java_defaults in the "merge conflicts expected" section, so that
module release branches can use the same defaults, but set it to
NetworkStackApiStableShims.

The shims are removed from FrameworksNetIntegrationTests, as they are
already available there through service-connectivity-pre-jarjar. Keeping
them as a dependency would make FrameworksNetIntegrationTests use both
Stable shims (directly) and Current shims
(through service-connectivity-pre-jarjar).

Bug: 266205506
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519

Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
This commit is contained in:
Remi NGUYEN VAN
2023-01-30 19:19:48 +09:00
committed by Motomu Utsumi
parent 8d4702a1f0
commit 02eee9aa5a
3 changed files with 26 additions and 2 deletions

View File

@@ -38,6 +38,13 @@ java_defaults {
name: "ConnectivityNextEnableDefaults",
enabled: true,
}
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"],
}
apex_defaults {
name: "ConnectivityApexDefaults",
// Tethering app to include in the AOSP apex. Branches that disable the "next" targets may use

View File

@@ -138,6 +138,14 @@ java_library {
name: "service-connectivity-pre-jarjar",
sdk_version: "system_server_current",
min_sdk_version: "30",
// NetworkStackApiShimSettingsForCurrentBranch provides the latest available shims depending on
// the branch to "service-connectivity".
// There are Tethering.apk and TetheringNext.apk variants for the tethering APEX,
// which use NetworkStackApiStableShims and NetworkStackApiCurrentShims respectively.
// Note that there can be no service-connectivity-next because it would need to be configured in
// default_art_config.mk which doesn't support conditionals, hence this scheme of using a
// variable here.
defaults: ["NetworkStackApiShimSettingsForCurrentBranch"],
srcs: [
"src/**/*.java",
":framework-connectivity-shared-srcs",
@@ -183,7 +191,6 @@ java_library {
"PlatformProperties",
"service-connectivity-protos",
"service-connectivity-stats-protos",
"NetworkStackApiStableShims",
],
apex_available: [
"com.android.tethering",

View File

@@ -21,7 +21,10 @@ package {
android_test {
name: "FrameworksNetIntegrationTests",
defaults: ["framework-connectivity-internal-test-defaults"],
defaults: [
"framework-connectivity-internal-test-defaults",
"NetworkStackApiShimSettingsForCurrentBranch",
],
platform_apis: true,
certificate: "platform",
srcs: [
@@ -33,6 +36,13 @@ android_test {
"ServiceConnectivityResources",
],
static_libs: [
// It does not matter if NetworkStackApiStableLib or NetworkStackApiCurrentLib is used here,
// since the shims for the branch are already included via
// NetworkStackApiShimSettingsForCurrentBranch, and will be used in priority as they are
// first in the classpath.
// If the wrong shims are used for some reason, tests that use newer APIs fail.
// TODO: have NetworkStackApiStableLib link dynamically against the shims to remove this
// order-dependent setup.
"NetworkStackApiStableLib",
"androidx.test.ext.junit",
"frameworks-net-integration-testutils",