Disable VNDK apexes for unsupported API levels

Disable VNDK apexes when their version is below the minimum
supported API level for the primary architecture.

Test: TestVndkApexCurrent
Change-Id: Ie72a5beb9da432660d3fec5c520402224326f961
This commit is contained in:
Colin Cross
2023-01-26 09:54:42 -08:00
parent 363ec76a6d
commit bb137a3956
3 changed files with 21 additions and 4 deletions

View File

@@ -20,7 +20,9 @@ import (
"android/soong/android"
)
func minApiForArch(ctx android.EarlyModuleContext,
// MinApiLevelForArch returns the ApiLevel for the Android version that
// first supported the architecture.
func MinApiForArch(ctx android.EarlyModuleContext,
arch android.ArchType) android.ApiLevel {
switch arch {
@@ -38,7 +40,7 @@ func minApiForArch(ctx android.EarlyModuleContext,
func nativeApiLevelFromUser(ctx android.BaseModuleContext,
raw string) (android.ApiLevel, error) {
min := minApiForArch(ctx, ctx.Arch().ArchType)
min := MinApiForArch(ctx, ctx.Arch().ArchType)
if raw == "minimum" {
return min, nil
}