aboutsummaryrefslogtreecommitdiffstats
path: root/java/hiddenapi.go
diff options
context:
space:
mode:
authorSam Mortimer <sam@mortimer.me.uk>2019-10-07 11:41:14 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-12-11 19:03:43 +0200
commitefa6a129b0954708e575069bef56fce1e234f0da (patch)
treeb3d135cc5e3da7b5cc8f1886ce3765028367c796 /java/hiddenapi.go
parent094c1b049a74506798c33d023a2a0df3506947c9 (diff)
downloadandroid_build_soong-efa6a129b0954708e575069bef56fce1e234f0da.tar.gz
android_build_soong-efa6a129b0954708e575069bef56fce1e234f0da.tar.bz2
android_build_soong-efa6a129b0954708e575069bef56fce1e234f0da.zip
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
Diffstat (limited to 'java/hiddenapi.go')
-rw-r--r--java/hiddenapi.go9
1 files changed, 8 insertions, 1 deletions
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")