Revert "cc: use platform sdk version for vendor/product variants"
Revert submission 3334193-no-llndk-versioning
Reason for revert: Droidmonitor created revert due to b/378038995. Will be verifying through ABTD before submission.
Reverted changes: /q/submissionid:3334193-no-llndk-versioning
Change-Id: I76eb9118407dfb2353384c312e17c40f4e590028
diff --git a/cc/cc.go b/cc/cc.go
index 0ed6238..5dee32e 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1567,11 +1567,12 @@
}
if ctx.ctx.Device() {
- // When building for vendor/product, use the latest _stable_ API as "current".
- // This is passed to clang/aidl compilers so that compiled/generated code works
- // with the system.
- if (ctx.inVendor() || ctx.inProduct()) && (ver == "" || ver == "current") {
- ver = ctx.ctx.Config().PlatformSdkVersion().String()
+ config := ctx.ctx.Config()
+ if ctx.inVendor() {
+ // If building for vendor with final API, then use the latest _stable_ API as "current".
+ if config.VendorApiLevelFrozen() && (ver == "" || ver == "current") {
+ ver = config.PlatformSdkVersion().String()
+ }
}
}