diff options
author | 2025-02-05 23:02:39 +0000 | |
---|---|---|
committer | 2025-02-07 16:00:28 -0800 | |
commit | 22558312b9c07ddda22fcd00d6a84aa0f73f4d10 (patch) | |
tree | f9f2362a5b9c874cd99dbdf47b82315229846477 /android/apex.go | |
parent | 10f6c32353292f22844dfd9945abc435969435e0 (diff) |
Reland: Move MutateApexTransition shortcut later
Returning from MutateApexTransition too early is allowing invalid
apex_available values to be ignored for modules that have no apex
variations. Move the exit later so that apex_available checks
happen and platform variants are hidden consistently.
This relands I324de8090a9f1a874b5b22f20b8d62bf22c7d79c along with
fixes to make more tests visible to the platform.
Bug: 394664568
Test: builds
Change-Id: I161dcefb8c7465eb2bf1bd924fb9c6e4ff5dea85
Diffstat (limited to 'android/apex.go')
-rw-r--r-- | android/apex.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/android/apex.go b/android/apex.go index c2f73a9c1..a5ccd520e 100644 --- a/android/apex.go +++ b/android/apex.go @@ -616,25 +616,26 @@ func MutateApexTransition(ctx BaseModuleContext, variation string) { apexInfos = allApexInfos.ApexInfos } - // Shortcut - if len(apexInfos) == 0 { - return + 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 + module.MakeUninstallable() } // Do some validity checks. // TODO(jiyong): is this the right place? base.checkApexAvailableProperty(ctx) + // Shortcut + if len(apexInfos) == 0 { + return + } + if !module.UniqueApexVariations() && !base.ApexProperties.UniqueApexVariationsForDeps { apexInfos, _ = mergeApexVariations(apexInfos) } - 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 - module.MakeUninstallable() - } if !platformVariation { var thisApexInfo ApexInfo |