From a0cf0a4a6686bbed09e07397423a6ce2cad586c4 Mon Sep 17 00:00:00 2001 From: Alyssa Ketpreechasawat Date: Thu, 26 Oct 2023 13:21:16 +0000 Subject: [PATCH] Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use. Following aosp/2822531, when MediaProvider prebuilt is enabled, framework-pdf (new jar) will be removed from PRODUCT_APEX_BOOT_JARS. Subsequently there will be an error around the inconsistency (unknown) between bootclasspath_fragment (source version of MP with framework-pdf in its content) and PRODUCT_APEX_BOOT_JARS (framework-pdf removed). Since the source version of bootclasspath_fragment is not in use, we should ignore this check. See more detail in go/stale-mainline-prebuilts (issue from changes in framework/service jars in existing apexes). Bug: 304719212 Test: lunch cf_x86_phone-next-userdebug & m Test: lunch cf_x86_phone-trunk-userdebug & m Change-Id: I0f62277a9e65522bf5a4ea1ae33c166f996c37d5 --- java/bootclasspath_fragment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index 7d8a9f7bb..e92e6e68f 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -582,7 +582,7 @@ func (b *BootclasspathFragmentModule) configuredJars(ctx android.ModuleContext) // So ignore it even if it is not in PRODUCT_APEX_BOOT_JARS. // TODO(b/202896428): Add better way to handle this. _, unknown = android.RemoveFromList("android.car-module", unknown) - if len(unknown) > 0 { + if isActiveModule(ctx.Module()) && len(unknown) > 0 { ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown) } }