Set __ANDROID_API__ for vendor modules to vndk version.
When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.
If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.
Bug: 74833244
Test: Build and check boot.
Change-Id: I383c76a36101e39c70575b463880b52d3e9d90bb
diff --git a/cc/cc.go b/cc/cc.go
index 4d26e84..6243625 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -502,10 +502,17 @@
func (ctx *moduleContextImpl) sdkVersion() string {
if ctx.ctx.Device() {
if ctx.useVndk() {
- return "current"
- } else {
- return String(ctx.mod.Properties.Sdk_version)
+ vndk_ver := ctx.ctx.DeviceConfig().VndkVersion()
+ if vndk_ver == "current" {
+ platform_vndk_ver := ctx.ctx.DeviceConfig().PlatformVndkVersion()
+ if inList(platform_vndk_ver, ctx.ctx.Config().PlatformVersionCombinedCodenames()) {
+ return "current"
+ }
+ return platform_vndk_ver
+ }
+ return vndk_ver
}
+ return String(ctx.mod.Properties.Sdk_version)
}
return ""
}