Merge "Add warning for modifying the vendor api level." into main
diff --git a/core/product.mk b/core/product.mk
index 1fbc3ee..30bbb0e 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -230,9 +230,6 @@
# 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
diff --git a/core/product_config.mk b/core/product_config.mk
index 13907f0..377bf6f 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -609,26 +609,23 @@
$(error sdk-to-vendor-api-level is broken for current $(call sdk-to-vendor-api-level,10000))
endif
-ifdef PRODUCT_SHIPPING_VENDOR_API_LEVEL
-# Follow the version that is set manually.
- VSR_VENDOR_API_LEVEL := $(PRODUCT_SHIPPING_VENDOR_API_LEVEL)
-else
- # VSR API level is the vendor api level of the product shipping API level.
- VSR_VENDOR_API_LEVEL := $(call sdk-to-vendor-api-level,$(PLATFORM_SDK_VERSION))
- ifdef PRODUCT_SHIPPING_API_LEVEL
- VSR_VENDOR_API_LEVEL := $(call sdk-to-vendor-api-level,$(PRODUCT_SHIPPING_API_LEVEL))
+# VSR API level is the vendor api level of the product shipping API level.
+VSR_VENDOR_API_LEVEL := $(call sdk-to-vendor-api-level,$(PLATFORM_SDK_VERSION))
+ifdef PRODUCT_SHIPPING_API_LEVEL
+ VSR_VENDOR_API_LEVEL := $(call sdk-to-vendor-api-level,$(PRODUCT_SHIPPING_API_LEVEL))
+endif
+ifdef BOARD_SHIPPING_API_LEVEL
+ # Vendors with GRF must define BOARD_SHIPPING_API_LEVEL for the vendor API level.
+ # In this case, the VSR API level is the minimum of the PRODUCT_SHIPPING_API_LEVEL
+ # and RELEASE_BOARD_API_LEVEL
+ board_api_level := $(RELEASE_BOARD_API_LEVEL)
+ ifdef BOARD_API_LEVEL_PROP_OVERRIDE
+ # This must be used only for testing purpose. Product must not be released
+ # with the modified api level value.
+ board_api_level := $(BOARD_API_LEVEL_PROP_OVERRIDE)
endif
- ifdef BOARD_SHIPPING_API_LEVEL
- # Vendors with GRF must define BOARD_SHIPPING_API_LEVEL for the vendor API level.
- # In this case, the VSR API level is the minimum of the PRODUCT_SHIPPING_API_LEVEL
- # and RELEASE_BOARD_API_LEVEL
- board_api_level := $(RELEASE_BOARD_API_LEVEL)
- ifdef BOARD_API_LEVEL_PROP_OVERRIDE
- board_api_level := $(BOARD_API_LEVEL_PROP_OVERRIDE)
- endif
- VSR_VENDOR_API_LEVEL := $(call math_min,$(VSR_VENDOR_API_LEVEL),$(board_api_level))
- board_api_level :=
- endif
+ VSR_VENDOR_API_LEVEL := $(call math_min,$(VSR_VENDOR_API_LEVEL),$(board_api_level))
+ board_api_level :=
endif
.KATI_READONLY := VSR_VENDOR_API_LEVEL
diff --git a/core/soong_extra_config.mk b/core/soong_extra_config.mk
index 8eee50a..1e8b2a2 100644
--- a/core/soong_extra_config.mk
+++ b/core/soong_extra_config.mk
@@ -14,7 +14,6 @@
$(call add_json_str, BoardPlatform, $(TARGET_BOARD_PLATFORM))
$(call add_json_str, BoardShippingApiLevel, $(BOARD_SHIPPING_API_LEVEL))
$(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL))
-$(call add_json_str, ShippingVendorApiLevel, $(PRODUCT_SHIPPING_VENDOR_API_LEVEL))
$(call add_json_str, ProductModel, $(PRODUCT_MODEL))
$(call add_json_str, ProductModelForAttestation, $(PRODUCT_MODEL_FOR_ATTESTATION))
diff --git a/core/sysprop_config.mk b/core/sysprop_config.mk
index 1991503..2e4c2ea 100644
--- a/core/sysprop_config.mk
+++ b/core/sysprop_config.mk
@@ -69,8 +69,11 @@
endif
ifdef PRODUCT_SHIPPING_VENDOR_API_LEVEL
-ADDITIONAL_VENDOR_PROPERTIES += \
- ro.vendor.api_level=$(PRODUCT_SHIPPING_VENDOR_API_LEVEL)
+# PRODUCT_SHIPPING_VENDOR_API_LEVEL was used to set ro.vendor.api_level
+# manually for testing. To prevent using this variable for product release,
+# remove this variable and show an error message.
+$(error PRODUCT_SHIPPING_VENDOR_API_LEVEL is not available. ro.vendor.api_level\
+ property must not be set manually)
endif
ifneq ($(TARGET_BUILD_VARIANT),user)
@@ -94,6 +97,9 @@
ADDITIONAL_VENDOR_PROPERTIES += \
ro.board.api_level?=$(BOARD_API_LEVEL)
ifdef BOARD_API_LEVEL_PROP_OVERRIDE
+ # This must be used only for testing purpose. Product must not be released
+ # with the modified api level value.
+ $(warning BOARD_API_LEVEL_PROP_OVERRIDE can be defined only for testing purpose)
ADDITIONAL_VENDOR_PROPERTIES += \
ro.board.api_level=$(BOARD_API_LEVEL_PROP_OVERRIDE)
endif