From 77d4c4efa87321d85f482b7bd9e5779f20b28690 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 3 Aug 2022 15:31:02 +0900 Subject: [PATCH] Only use framework-connectivity stubs for -t stubs Do not use framework-connectivity stubs for framework-connectivity-t-pre-jarjar, as that library can build against the full framework-connectivity implementation including hidden symbols: it already builds against framework-connectivity-pre-jarjar. The stubs are only necessary to build framework-connectivity-t stubs, to avoid circular dependencies between these and the framework-connectivity implementation. This change allows using hidden symbols of framework-connectivity in framework-connectivity-t-pre-jarjar, but does not fully fix the problem as framework-connectivity-t will use the framework-connectivity stubs both to build its own stubs and to build its implementation library, due to "libs" being used in both cases (and prioritized over impl_only_libs). As a result, it is still not possible to build framework-connectivity-t when it references hidden symbols of classes that are also part of the stubs. Still, this is a first step and organizes the build rules closer to what they should be. Bug: 139774492 Test: m Change-Id: I5e696fa6a7871d048e0ba16442de33b5f139faae --- framework-t/Android.bp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/framework-t/Android.bp b/framework-t/Android.bp index 80477f105a..ea73b5f1ce 100644 --- a/framework-t/Android.bp +++ b/framework-t/Android.bp @@ -43,14 +43,9 @@ java_defaults { ":framework-connectivity-tiramisu-updatable-sources", ":framework-nearby-java-sources", ], - stub_only_libs: [ - // Use prebuilt framework-connectivity stubs to avoid circular dependencies - "sdk_module-lib_current_framework-connectivity", - ], libs: [ "unsupportedappusage", "app-compat-annotations", - "sdk_module-lib_current_framework-connectivity", ], impl_only_libs: [ // The build system will use framework-bluetooth module_current stubs, because @@ -104,6 +99,13 @@ java_sdk_library { // The jarjar rules are only so that references to jarjared utils in // framework-connectivity-pre-jarjar match at runtime. jarjar_rules: ":framework-connectivity-jarjar-rules", + stub_only_libs: [ + // Use prebuilt framework-connectivity stubs to avoid circular dependencies + "sdk_module-lib_current_framework-connectivity", + ], + libs: [ + "sdk_module-lib_current_framework-connectivity", + ], permitted_packages: [ "android.app.usage", "android.net",