diff options
| author | 2023-02-16 14:54:05 -0800 | |
|---|---|---|
| committer | 2023-02-20 20:04:14 -0800 | |
| commit | dd2c76e77203821e176630fdc3e25e884ee8082f (patch) | |
| tree | 27e60c7889774180b539d396b0e365f6507d1b5d | |
| parent | 4196e13a6ac46d7b93e581eb577be3472268c105 (diff) | |
Add an `Override_apex_available` property for APEX
This property allows an APEX bundle to ignore the apex_available rules
defined in its dependencies, effectively allowing it to use any APEX
as its dependency.
Bug: 269660351
Test: m
Change-Id: Ib2797e04438ad908ac10b256dce07a7819e836b3
| -rw-r--r-- | apex/apex.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go index b77568dd3..9a80aa880 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -141,6 +141,9 @@ type apexBundleProperties struct { // Default: true. Installable *bool + // Whether this APEX ignores the apex_available list defined in its dependencies. + Override_apex_available *bool + // If set true, VNDK libs are considered as stable libs and are not included in this APEX. // Should be only used in non-system apexes (e.g. vendor: true). Default is false. Use_vndk_as_stable *bool @@ -1513,6 +1516,10 @@ func (a *apexBundle) UsePlatformApis() bool { return proptools.BoolDefault(a.properties.Platform_apis, false) } +func (a *apexBundle) OverrideApexAvailable() bool { + return proptools.BoolDefault(a.properties.Override_apex_available, false) +} + // getCertString returns the name of the cert that should be used to sign this APEX. This is // basically from the "certificate" property, but could be overridden by the device config. func (a *apexBundle) getCertString(ctx android.BaseModuleContext) string { @@ -3040,6 +3047,11 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) { return } + // Ignore availability when `override_apex_available` is true. + if a.OverrideApexAvailable() { + return + } + a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool { // As soon as the dependency graph crosses the APEX boundary, don't go further. if externalDep { |