droidstubs: pass in --current-version <major.minor> to metalava

Instead of just passing the API level (or just the major SDK version) to
metalava via --current-version, pass in both major and minor version
(e.g. --current-version 36.1).

Ideally ApiLevel should be updated to support minor versions (and
potentially renamed SdkVersion), but that work falls outside the scope
of this CL which is intended to unblock work to support an SDK with a
non-zero minor version.

Bug: 392838750
Bug: 397644333
Test: m nothing
Ignore-AOSP-First: minor SDK development takes place on internal main
Change-Id: I17151b357dd06176dbaab3f9bdea29affe5c5011
diff --git a/android/config.go b/android/config.go
index acaad60..760a389 100644
--- a/android/config.go
+++ b/android/config.go
@@ -990,6 +990,10 @@
 	return uncheckedFinalApiLevel(*c.productVariables.Platform_sdk_version)
 }
 
+func (c *config) PlatformSdkVersionFull() string {
+	return proptools.StringDefault(c.productVariables.Platform_sdk_version_full, "")
+}
+
 func (c *config) RawPlatformSdkVersion() *int {
 	return c.productVariables.Platform_sdk_version
 }
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 24dabdb3..40d6f18 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -564,7 +564,15 @@
 		})
 	}
 	if apiVersions != nil {
-		cmd.FlagWithArg("--current-version ", ctx.Config().PlatformSdkVersion().String())
+		// We are migrating from a single API level to major.minor
+		// versions and PlatformSdkVersionFull is not yet set in all
+		// release configs. If it is not set, fall back on the single
+		// API level.
+		if fullSdkVersion := ctx.Config().PlatformSdkVersionFull(); len(fullSdkVersion) > 0 {
+			cmd.FlagWithArg("--current-version ", fullSdkVersion)
+		} else {
+			cmd.FlagWithArg("--current-version ", ctx.Config().PlatformSdkVersion().String())
+		}
 		if ctx.Config().PlatformSdkVersion().String() != "36" || ctx.Config().PlatformSdkCodename() != "Baklava" {
 			cmd.FlagWithArg("--current-codename ", ctx.Config().PlatformSdkCodename())
 		}