Skip to content
Snippets Groups Projects
Commit 7858562b authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Split out connectivity-t-pre-jarjar and tests

The pre-jarjar variant is necessary so that service-t can depend on
hidden symbols in framework-t that reference (for example as parameter)
classes that are jarjared.
Without this, when depending on framework-connectivity-tiramisu.impl,
service-connectivity-t would see post-jarjar symbols that do not match
the classnames it uses in its code.

Also split FrameworksNetTestsLib so that the same jarjar rules can be
applied between the tests and the module, avoiding different errors
between FrameworksNetTests and ConnectivityCoverageTests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 204830222
Test: m
Change-Id: I3d0c081c4a7422e128beee11c0156f01b0377c96
parent 7b84bcfc
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ java_defaults {
// 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 {
name: "framework-connectivity-tiramisu",
java_defaults {
name: "framework-connectivity-tiramisu-defaults",
sdk_version: "module_current",
min_sdk_version: "Tiramisu",
defaults: [
......@@ -41,10 +41,6 @@ java_sdk_library {
":framework-connectivity-tiramisu-updatable-sources",
":framework-nearby-java-sources",
],
// 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.
jarjar_rules: ":connectivity-jarjar-rules",
stub_only_libs: [
// Use prebuilt framework-connectivity stubs to avoid circular dependencies
"sdk_module-lib_current_framework-connectivity",
......@@ -67,6 +63,33 @@ java_sdk_library {
// non-jarjard names of widely-used packages such as com.android.net.module.util.
"framework-connectivity-pre-jarjar",
],
apex_available: [
"com.android.tethering",
],
}
java_library {
name: "framework-connectivity-tiramisu-pre-jarjar",
defaults: ["framework-connectivity-tiramisu-defaults"],
libs: [
"framework-bluetooth",
"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 {
name: "framework-connectivity-tiramisu",
defaults: [
"framework-connectivity-tiramisu-defaults",
],
// 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.
jarjar_rules: ":connectivity-jarjar-rules",
permitted_packages: [
"android.net",
"android.net.nsd",
......@@ -74,9 +97,6 @@ java_sdk_library {
"com.android.connectivity",
"com.android.nearby",
],
apex_available: [
"com.android.tethering",
],
impl_library_visibility: [
"//packages/modules/Connectivity/Tethering/apex",
// In preparation for future move
......
......@@ -37,7 +37,8 @@ java_library {
libs: [
"framework-annotations-lib",
"framework-connectivity-pre-jarjar",
"framework-connectivity-tiramisu.impl",
"framework-connectivity-tiramisu-pre-jarjar",
"framework-tethering.stubs.module_lib",
"service-connectivity-pre-jarjar",
"service-nearby",
"unsupportedappusage",
......
......@@ -88,6 +88,7 @@ android_test {
"libstaticjvmtiagent",
// For NetworkStackUtils included in NetworkStackBase
"libnetworkstackutilsjni",
"libandroid_net_connectivity_com_android_net_module_util_jni",
"libcom_android_networkstack_tethering_util_jni",
// For framework tests
"libservice-connectivity",
......
......@@ -107,8 +107,8 @@ java_library {
visibility: ["//visibility:private"],
}
android_library {
name: "FrameworksNetTestsLib",
java_defaults {
name: "FrameworksNetTestsDefaults",
min_sdk_version: "30",
defaults: [
"framework-connectivity-test-defaults",
......@@ -117,8 +117,6 @@ android_library {
"java/**/*.java",
"java/**/*.kt",
],
exclude_srcs: [":non-connectivity-module-test"],
jarjar_rules: "jarjar-rules.txt",
static_libs: [
"androidx.test.rules",
"androidx.test.uiautomator",
......@@ -144,31 +142,33 @@ android_library {
"android.test.mock",
"ServiceConnectivityResources",
],
visibility: ["//packages/modules/Connectivity/tests:__subpackages__"],
exclude_kotlinc_generated_files: false,
}
android_library {
name: "FrameworksNetTestsLib",
defaults: [
"FrameworksNetTestsDefaults",
],
exclude_srcs: [":non-connectivity-module-test"],
visibility: ["//packages/modules/Connectivity/tests:__subpackages__"],
}
android_test {
name: "FrameworksNetTests",
enabled: enable_frameworks_net_tests,
min_sdk_version: "30",
defaults: [
"framework-connectivity-test-defaults",
"FrameworksNetTestsDefaults",
"FrameworksNetTests-jni-defaults",
],
// this is in addition to FrameworksNetTestsLib.
srcs: [":non-connectivity-module-test"],
jarjar_rules: ":connectivity-jarjar-rules",
test_suites: ["device-tests"],
static_libs: [
"services.core",
"services.net",
"FrameworksNetTestsLib",
],
libs: [
"android.test.mock",
"android.test.base",
],
jni_libs: [
"libservice-connectivity",
]
"libandroid_net_connectivity_com_android_net_module_util_jni",
],
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment