Define PLATFORM_VNDK_VERSION

PLATFORM_VNDK_VERSION means the VNDK version that current build
provides. This value will be set to PLATFORM_SDK_VERSION once the
version is release. Otherwise, it will be set to "current".

Bug: 69883025
Test: device boot
Change-Id: I3fde4943aa062d9d148a3d7fc2798948870a48c6
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index ca7401b..32d9003 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -26,6 +26,7 @@
 #     BUILD_NUMBER
 #     BUILD_DATETIME
 #     PLATFORM_SECURITY_PATCH
+#     PLATFORM_VNDK_VERSION
 #
 
 # Look for an optional file containing overrides of the defaults,
@@ -183,6 +184,23 @@
   endif
 endif
 
+ifndef PLATFORM_VNDK_VERSION
+  # This is the definition of the VNDK version for the current VNDK libraries.
+  # The version is only available when PLATFORM_VERSION_CODENAME == REL.
+  # Otherwise, it will be set to "current". The ABI is allowed to be changed
+  # only if PLATFORM_VNDK_VERSION == current. Once PLATFORM_VNDK_VERSION is set
+  # to actual version, the ABI for this version will be frozon and emit build
+  # errors if any ABI for the VNDK libs are changed.
+  # After that the snapshot of the VNDK with this version will be generated.
+  #
+  # The version follows PLATFORM_SDK_VERSION.
+  ifeq (REL,$(PLATFORM_VERSION_CODENAME))
+    PLATFORM_VNDK_VERSION := $(PLATFORM_SDK_VERSION)
+  else
+    PLATFORM_VNDK_VERSION := current
+  endif
+endif
+
 ifndef PLATFORM_SECURITY_PATCH
     #  Used to indicate the security patch that has been applied to the device.
     #  It must signify that the build includes all security patches issued up through the designated Android Public Security Bulletin.