Merge "Use current shims in service-connectivity"

This commit is contained in:
Treehugger Robot
2023-03-27 09:03:39 +00:00
committed by Gerrit Code Review
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",