Merge "Workaround prebuilt name conflict for service-connectivity" am: 6adec090ca

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2107608

Change-Id: I341d330aabd6ede7c43543d6bb474a8a6c1fd1ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-06-09 13:28:53 +00:00 • committed by Automerger Merge Worker
commit ecc552f530
3 changed files with 22 additions and 5 deletions

View file

@ -198,11 +198,10 @@ java_library {
lint: { strict_updatability_linting: true },
}
java_library {
name: "service-connectivity",
java_defaults {
name: "service-connectivity-defaults",
sdk_version: "system_server_current",
min_sdk_version: "30",
installable: true,
// This library combines system server jars that have access to different bootclasspath jars.
// Lower SDK service jars must not depend on higher SDK jars as that would let them
// transitively depend on the wrong bootclasspath jars. Sources also cannot be added here as
@ -224,6 +223,24 @@ java_library {
lint: { strict_updatability_linting: true },
}
// A special library created strictly for use by the tests as they need the
// implementation library but that is not available when building from prebuilts.
// Using a library with a different name to what is used by the prebuilts ensures
// that this will never depend on the prebuilt.
// Switching service-connectivity to a java_sdk_library would also have worked as
// that has built in support for managing this but that is too big a change at this
// point.
java_library {
name: "service-connectivity-for-tests",
defaults: ["service-connectivity-defaults"],
}
java_library {
name: "service-connectivity",
defaults: ["service-connectivity-defaults"],
installable: true,
}
filegroup {
name: "connectivity-jarjar-rules",
srcs: ["jarjar-rules.txt"],

View file

@ -71,7 +71,7 @@ java_library {
"net-tests-utils",
],
libs: [
"service-connectivity",
"service-connectivity-for-tests",
"services.core",
"services.net",
],

View file

@ -22,6 +22,6 @@ android_test {
static_libs: [
"androidx.test.rules",
"mockito-target-minus-junit4",
"service-connectivity",
"service-connectivity-for-tests",
],
}