Define PRODUCT_SHIPPING_VENDOR_API_LEVEL

Devices may set its first vendor api level to
PRODUCT_SHIPPING_VENDOR_API_LEVEL. This will manually set to
ro.vendor.api_level and will be used by tests.

If this value is not defined, init process will automatically
calculate the ro.vendor.api_level property for tests.

Bug: 326164316
Test: Check vendor/build.prop
Change-Id: I89f844ffaad9e3e39deab1c680bd1f7f17f4d8ad
diff --git a/core/main.mk b/core/main.mk
index b4ca2a4..c1cafc0 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -284,6 +284,11 @@
     ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
 endif
 
+ifdef PRODUCT_SHIPPING_VENDOR_API_LEVEL
+ADDITIONAL_VENDOR_PROPERTIES += \
+    ro.vendor.api_level=$(PRODUCT_SHIPPING_VENDOR_API_LEVEL)
+endif
+
 ifneq ($(TARGET_BUILD_VARIANT),user)
   ifdef PRODUCT_SET_DEBUGFS_RESTRICTIONS
     ADDITIONAL_VENDOR_PROPERTIES += \
diff --git a/core/product.mk b/core/product.mk
index 60cab47..d64dde2 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -230,6 +230,9 @@
 # The first API level this product shipped with
 _product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL
 
+# The first vendor API level this product shipped with
+_product_single_value_vars += PRODUCT_SHIPPING_VENDOR_API_LEVEL
+
 _product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES
 _product_list_vars += VENDOR_EXCEPTION_MODULES
 _product_list_vars += VENDOR_EXCEPTION_PATHS