From 78349b56a06c9578a2da427bc5c4986020c0cc57 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 12 May 2021 17:13:56 +0900 Subject: Record the actual APEXes that a module is part of. Consider this case: apex { name: "com.android.foo", native_libs: ["foo"], } override_apex { name: "com.mycompany.android.foo", base: "com.android.foo", } cc_library { name: "foo", } There are two APEXes defined: "com.android.foo" and "com.mycompany.android.foo" which is a copy of "com.android.foo" with some properties overridden (e.g. signing keys). The module "foo" is mutated into two variants by the apex mutator: the platform variant and the apex variant. The former has the variation name "" and the later has "apex" which usually is "apex10000". Internally, the apex variant has an alias "com.android.foo". ApexInfo.InApexVariants() returns only "com.android.foo" when called for the module "foo". We can see that the information that "foo" is also part of "com.mycompany.android.foo" is completely lost. This is causing problem when we compare the apex membership by their "soong module name", not the "apex name". In the example above, the two modules have different soone module names, but have the same apex name: "com.android.foo". To fix that, this CL introduces a new field `InApexes` to the `ApexInfo` struct. It has the actual name of the APEXes that the module is part of. With the example above, `InApexes` is ["com.android.foo", "com.mycompany.android.foo"]. Bug: 180325915 Test: m nothing Test: m nothing on non-AOSP targets with ag/13740887 applied. Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e --- java/boot_jars.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/boot_jars.go') diff --git a/java/boot_jars.go b/java/boot_jars.go index 1f2dab58f..7abda8031 100644 --- a/java/boot_jars.go +++ b/java/boot_jars.go @@ -89,7 +89,7 @@ func (b *bootJarsSingleton) GenerateBuildActions(ctx android.SingletonContext) { name := android.RemoveOptionalPrebuiltPrefix(ctx.ModuleName(module)) if apex, ok := moduleToApex[name]; ok { apexInfo := ctx.ModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo) - if (apex == "platform" && apexInfo.IsForPlatform()) || apexInfo.InApexVariantByBaseName(apex) { + if (apex == "platform" && apexInfo.IsForPlatform()) || apexInfo.InApexModule(apex) { // The module name/apex variant should be unique in the system but double check // just in case something has gone wrong. if existing, ok := nameToApexVariant[name]; ok { -- cgit v1.2.3-59-g8ed1b