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
This commit is contained in:
Spandan Das
2024-08-30 22:43:46 +00:00
parent c540beef74
commit afa3add57e

View File

@@ -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