Use RELEASE_PLATFORM_SDK_VERSION_FULL instead of RELEASE_PLATFORM_SDK_MINOR_VERSION

RELEASE_PLATFORM_SDK_MINOR_VERSION has been replaced by
RELEASE_PLATFORM_SDK_VERSION_FULL (because we don't want to refer to the
minor version in isolation; *SDK_VERSION_FULL encodes both major and
minor version in the same variable).

If the value of RELEASE_PLATFORM_SDK_VERSION_FULL is the empty string
(the default), the build will synthesize a value by concatenating
RELEASE_PLATFORM_SDK_VERSION and ".0", resulting in e.g. "35.0".

If the value of RELEASE_PLATFORM_SDK_VERSION_FULL, it is assumed to be
on the format "<major>.<minor>", and the <major> part must match the
value of RELEASE_PLATFORM_SDK_VERSION.

Bug: 380235511
Test: atest CtsOsTestCases:BuildTest
Ignore-AOSP-First: minor versions do not exist in AOSP yet
Change-Id: Ibec28ed9317b5d561250335a26ef760a860f34f9
diff --git a/core/soong_config.mk b/core/soong_config.mk
index ace025e..8bfa08d 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -38,6 +38,7 @@
 $(call add_json_str,  Platform_display_version_name,     $(PLATFORM_DISPLAY_VERSION))
 $(call add_json_str,  Platform_version_name,             $(PLATFORM_VERSION))
 $(call add_json_val,  Platform_sdk_version,              $(PLATFORM_SDK_VERSION))
+$(call add_json_val,  Platform_sdk_version_full,         $(PLATFORM_SDK_VERSION_FULL))
 $(call add_json_str,  Platform_sdk_codename,             $(PLATFORM_VERSION_CODENAME))
 $(call add_json_bool, Platform_sdk_final,                $(filter REL,$(PLATFORM_VERSION_CODENAME)))
 $(call add_json_val,  Platform_sdk_extension_version,    $(PLATFORM_SDK_EXTENSION_VERSION))
diff --git a/core/sysprop.mk b/core/sysprop.mk
index aba6f8b..e7cd297 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -79,7 +79,7 @@
     echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
     echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
     echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
-    echo "ro.$(1).build.version.sdk_minor=$(PLATFORM_SDK_MINOR_VERSION)" >> $(2);\
+    echo "ro.$(1).build.version.sdk_full=$(PLATFORM_SDK_VERSION_FULL)" >> $(2);\
 
 endef
 
diff --git a/core/version_util.mk b/core/version_util.mk
index ddcbda2..cc94063 100644
--- a/core/version_util.mk
+++ b/core/version_util.mk
@@ -22,6 +22,7 @@
 #     PLATFORM_VERSION
 #     PLATFORM_DISPLAY_VERSION
 #     PLATFORM_SDK_VERSION
+#     PLATFORM_SDK_VERSION_FULL
 #     PLATFORM_SDK_EXTENSION_VERSION
 #     PLATFORM_BASE_SDK_EXTENSION_VERSION
 #     PLATFORM_VERSION_CODENAME
@@ -62,11 +63,18 @@
 PLATFORM_SDK_VERSION := $(RELEASE_PLATFORM_SDK_VERSION)
 .KATI_READONLY := PLATFORM_SDK_VERSION
 
-ifdef PLATFORM_SDK_MINOR_VERSION
-  $(error Do not set PLATFORM_SDK_MINOR_VERSION directly. Use RELEASE_PLATFORM_SDK_MINOR_VERSION. value: $(PLATFORM_SDK_MINOR_VERSION))
+ifdef PLATFORM_SDK_VERSION_FULL
+  $(error Do not set PLATFORM_SDK_VERSION_FULL directly. Use RELEASE_PLATFORM_SDK_VERSION_FULL. value: $(PLATFORM_SDK_VERSION_FULL))
 endif
-PLATFORM_SDK_MINOR_VERSION := $(RELEASE_PLATFORM_SDK_MINOR_VERSION)
-.KATI_READONLY := PLATFORM_SDK_MINOR_VERSION
+ifeq ($(RELEASE_PLATFORM_SDK_VERSION_FULL),)
+  PLATFORM_SDK_VERSION_FULL := "$(PLATFORM_SDK_VERSION).0"
+else
+  ifneq ($(RELEASE_PLATFORM_SDK_VERSION),$(word 1,$(subst ., ,$(RELEASE_PLATFORM_SDK_VERSION_FULL))))
+    $(error if RELEASE_PLATFORM_SDK_VERSION_FULL ($(RELEASE_PLATFORM_SDK_VERSION_FULL)) is set, its major version must match RELEASE_PLATFORM_SDK_VERSION ($(RELEASE_PLATFORM_SDK_VERSION)))
+  endif
+  PLATFORM_SDK_VERSION_FULL := "$(RELEASE_PLATFORM_SDK_VERSION_FULL)"
+endif
+.KATI_READONLY := PLATFORM_SDK_VERSION_FULL
 
 ifdef PLATFORM_SDK_EXTENSION_VERSION
   $(error Do not set PLATFORM_SDK_EXTENSION_VERSION directly. Use RELEASE_PLATFORM_SDK_EXTENSION_VERSION. value: $(PLATFORM_SDK_EXTENSION_VERSION))