From efa6a129b0954708e575069bef56fce1e234f0da Mon Sep 17 00:00:00 2001 From: Sam Mortimer Date: Mon, 7 Oct 2019 11:41:14 -0700 Subject: soong: Give priority to modules in exported namespaces for bootjars * Looking for modules that provide a boot jar is currently done by module name match only. This breaks when you have multiple copies of the same module in your build tree (eg in another device). * Add a new mutator that marks the modules that should be used for bootjar content. * The logic is simple: give priority to modules that are in exported soong namespace. Change-Id: I2476174b892475c14a9f10b5e66b8496186f81c0 --- java/hiddenapi.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'java/hiddenapi.go') diff --git a/java/hiddenapi.go b/java/hiddenapi.go index 6020aba6..28724f2a 100644 --- a/java/hiddenapi.go +++ b/java/hiddenapi.go @@ -73,7 +73,14 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, dexJar android.ModuleOu // to the hidden API for the bootclassloader. If information is gathered for modules // not on the list then that will cause failures in the CtsHiddenApiBlacklist... // tests. - if inList(bootJarName, ctx.Config().BootJars()) { + isBootJarProvider := false + ctx.VisitAllModuleVariants(func(module android.Module) { + if m, ok := module.(interface{ BootJarProvider() bool }); ok && + m.BootJarProvider() { + isBootJarProvider = true + } + }) + if isBootJarProvider && inList(bootJarName, ctx.Config().BootJars()) { // Derive the greylist from classes jar. flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv") metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv") -- cgit v1.2.3