Revert "Revert "cc: use platform sdk version for vendor/product ..."

Revert submission 3341364-revert-3334193-no-llndk-versioning-YOLDNTJGYM

Reason for revert: with broken target fixed.
- LLNDK stubs with all symbols (999999 as "future" vendor api level)

Reverted changes: /q/submissionid:3341364-revert-3334193-no-llndk-versioning-YOLDNTJGYM

Bug: 362658565
Test: builds
Change-Id: Iadef279c10d3050c8fe7bff2465e22cb63080a1f
diff --git a/cc/cc.go b/cc/cc.go
index 60cf011..08a93cb9 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1560,12 +1560,11 @@
 	}
 
 	if ctx.ctx.Device() {
-		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()
-			}
+		// 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()
 		}
 	}