From 984b069ce2bff0ab46f18c65fbd4a11a35b91c97 Mon Sep 17 00:00:00 2001 From: Linus Tufvesson Date: Fri, 12 Apr 2024 12:18:06 +0200 Subject: [PATCH] Use flag for min supported target sdk Test: Build and flash Test: adb shell getprop ro.build.version.min_supported_target_sdk Bug: 297603927 Change-Id: I3a2bcad6b001364a2cf35cad1cac7f69185169d0 --- core/soong_config.mk | 2 -- core/version_util.mk | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/soong_config.mk b/core/soong_config.mk index 3cffef2538..534270e308 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -52,8 +52,6 @@ $(call add_json_str, Platform_version_known_codenames, $(PLATFORM_VERSION_KNOW $(call add_json_bool, Release_aidl_use_unfrozen, $(RELEASE_AIDL_USE_UNFROZEN)) -$(call add_json_str, Platform_min_supported_target_sdk_version, $(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)) - $(call add_json_bool, Allow_missing_dependencies, $(filter true,$(ALLOW_MISSING_DEPENDENCIES))) $(call add_json_bool, Unbundled_build, $(TARGET_BUILD_UNBUNDLED)) $(call add_json_list, Unbundled_build_apps, $(TARGET_BUILD_APPS)) diff --git a/core/version_util.mk b/core/version_util.mk index 610cdaf107..eb568becc4 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -221,10 +221,8 @@ ifndef HAS_BUILD_NUMBER endif .KATI_READONLY := HAS_BUILD_NUMBER -ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION - # Used to set minimum supported target sdk version. Apps targeting sdk - # version lower than the set value will result in a warning being shown - # when any activity from the app is started. - PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28 +ifdef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION + $(error Do not set PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION directly. Use RELEASE_PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION. value: $(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)) endif +PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := $(RELEASE_PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION) .KATI_READONLY := PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION