summaryrefslogtreecommitdiff
path: root/apex/vndk.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/vndk.go')
-rw-r--r--apex/vndk.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/apex/vndk.go b/apex/vndk.go
index ef3e5e1c5..80560cf0c 100644
--- a/apex/vndk.go
+++ b/apex/vndk.go
@@ -65,8 +65,23 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
}
vndkVersion := ab.vndkVersion(mctx.DeviceConfig())
+
// Ensure VNDK APEX mount point is formatted as com.android.vndk.v###
ab.properties.Apex_name = proptools.StringPtr(vndkApexNamePrefix + vndkVersion)
+
+ apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
+ if err != nil {
+ mctx.PropertyErrorf("vndk_version", "%s", err.Error())
+ return
+ }
+
+ targets := mctx.MultiTargets()
+ if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) {
+ // Disable VNDK apexes for VNDK versions less than the minimum supported API level for the primary
+ // architecture.
+ ab.Disable()
+ }
+
}
}