Set BOARD_SYSTEMSDK_VERSIONS automatically for P-launching device
Like BOARD_VNDK_VERSION is automatically set, BOARD_SYSTEMSDK_VERSIONS
is also automatically set to the latest supported SystemSDK version when
it is unset. Specifically, it is set when
1) it isn't explicitly set by the vendor and
2) the device is P-launching device (PRODUCT_SHIPPING_API_LEVEL >= 28)
Bug: 78431725
Test: m -j
Test: `get_build_var BOARD_SYSTEMSDK_VERSIONS` return P for 2018 Pixels.
Change-Id: I036a07da3ce58bdf22d252b6ef18263c7da3602a
diff --git a/core/config.mk b/core/config.mk
index 653dc69..b33fb11 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -840,6 +840,21 @@
.KATI_READONLY := \
PRODUCT_USE_VNDK
+# Set BOARD_SYSTEMSDK_VERSIONS to the latest SystemSDK version starting from P-launching
+# devices if unset.
+ifndef BOARD_SYSTEMSDK_VERSIONS
+ ifdef PRODUCT_SHIPPING_API_LEVEL
+ ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),28),)
+ ifeq (REL,$(PLATFORM_VERSION_CODENAME))
+ BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_SDK_VERSION)
+ else
+ BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_VERSION_CODENAME)
+ endif
+ endif
+ endif
+endif
+
+
ifdef PRODUCT_SHIPPING_API_LEVEL
ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),27),)
ifneq ($(TARGET_USES_MKE2FS),true)