summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-04-27 15:23:28 +0100
committer Paul Duffin <paulduffin@google.com> 2021-04-30 12:10:54 +0100
commitd6894ca4b97adc7afc87762c52401e0a4d86288a (patch)
tree7b48de15336c1c171337f4551aa4e596eb09a581 /java/hiddenapi_singleton.go
parentf23bc472b091dd809245e9e92d42a58f849182a3 (diff)
Split findAndCopyBootJars into separate find and copy functions
The main difference between the dexpreopt_bootjars singleton and the platform_bootclasspath singleton module is the way they find the modules to use. The former searches all modules, the latter adds dependencies on the modules that they need. This change separates the finding of the modules from the copying of the boot jars for those modules to make it easier to move the remaining functionality to platform_bootclasspath. This temporarily creates a singleton specific copy of the hidden API function isModuleInConfiguredList() to select the modules in place of the logic in the getBootJar() method. There is a slight loss of context information from the error messages but as these methods will be removed once the boot image creation has moved this is not an issue. While switching the isModuleInConfiguredListForSingleton() to use the SingletonContext the error message was fixed to include the name of the module with the issue. Bug: 177892522 Test: m nothing Change-Id: Iaea906da95d9da5301fb964fc593890f2216d336
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 43d54bfd3..f6af50132 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -151,8 +151,7 @@ func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext)
// Checks to see whether the supplied module variant is in the list of boot jars.
//
-// This is similar to logic in getBootImageJar() so any changes needed here are likely to be needed
-// there too.
+// Apart from the context this is identical to isModuleInConfiguredListForSingleton.
//
// TODO(b/179354495): Avoid having to perform this type of check or if necessary dedup it.
func isModuleInConfiguredList(ctx android.BaseModuleContext, module android.Module, configuredBootJars android.ConfiguredJarList) bool {
@@ -169,7 +168,7 @@ func isModuleInConfiguredList(ctx android.BaseModuleContext, module android.Modu
// It is an error if the module is not an ApexModule.
if _, ok := module.(android.ApexModule); !ok {
- ctx.ModuleErrorf("is configured in boot jars but does not support being added to an apex")
+ ctx.ModuleErrorf("%s is configured in boot jars but does not support being added to an apex", ctx.OtherModuleName(module))
return false
}