From afa3add57ea74e86f5bc5a9da61af4541458c0b9 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Fri, 30 Aug 2024 22:43:46 +0000 Subject: [PATCH] HideFromMake in `apexTransitionMutator` should respect special cases At ToT, platform variants of modules are hidden from make, unless the module has `//apex_available:platform` in its Android.bp file. However, there are special cases which always require the platform variant to be visible to make - e.g. bootstrap bionic libraries. `markPlatformAvailability` handles these special cases. This CL updates the subsequent apexTransitionMutator to hide the platform variant when module.NotAvailableForPlatform is true in addition to the existing module type specific `AvailableFor` check Test: no diff in file_list.txt Bug: 281077552 Change-Id: Ie9d7341e206276ff96d3d64fec21b8f5dcfd6ceb --- android/apex.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/apex.go b/android/apex.go index 79ee0a8f8..c4d1a710b 100644 --- a/android/apex.go +++ b/android/apex.go @@ -700,7 +700,7 @@ func MutateApexTransition(ctx BaseModuleContext, variation string) { base.ApexProperties.InAnyApex = true base.ApexProperties.DirectlyInAnyApex = inApex == directlyInApex - if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) { + if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() { // Do not install the module for platform, but still allow it to output // uninstallable AndroidMk entries in certain cases when they have side // effects. TODO(jiyong): move this routine to somewhere else