Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a44d1f0 authored by Sundong Ahn's avatar Sundong Ahn
Browse files

Add LOCAL_SDK_VERSION := system_$(VER)

The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe)
parent b8d6ac21
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ $(call pretty-error,Only one of LOCAL_PROPRIETARY_MODULE[$(LOCAL_PROPRIETARY_MOD
endif

include $(BUILD_SYSTEM)/local_vndk.mk
include $(BUILD_SYSTEM)/local_vsdk.mk

my_module_tags := $(LOCAL_MODULE_TAGS)
ifeq ($(my_host_cross),true)
+1 −1
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ else
ifneq (,$(LOCAL_SDK_VERSION))
# Set target-api for LOCAL_SDK_VERSIONs other than current.
ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
renderscript_target_api := $(LOCAL_SDK_VERSION)
renderscript_target_api := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION))
endif
endif  # LOCAL_SDK_VERSION is set
endif  # LOCAL_RENDERSCRIPT_TARGET_API is set
+5 −0
Original line number Diff line number Diff line
@@ -875,6 +875,11 @@ TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\
    $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \
    $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar)))

TARGET_AVAILABLE_SDK_VERSIONS := $(addprefix system_,$(call numerically_sort,\
    $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android_system.jar,%, \
    $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android_system.jar)))) \
    $(TARGET_AVAILABLE_SDK_VERSIONS)

# We don't have prebuilt test_current SDK yet.
TARGET_AVAILABLE_SDK_VERSIONS := test_current $(TARGET_AVAILABLE_SDK_VERSIONS)

+19 −0
Original line number Diff line number Diff line
@@ -3386,3 +3386,22 @@ $(foreach source,$(ENFORCE_RRO_SOURCES), \
  $(eval ALL_MODULES.$(enforce_rro_source_module).REQUIRED += $(enforce_rro_module)) \
)
endef

###########################################################
## Find system_$(VER) in LOCAL_SDK_VERSION
##
## $(1): LOCAL_SDK_VERSION
###########################################################
define has-system-sdk-version
$(filter system_%,$(1))
endef

###########################################################
## Get numerical version in LOCAL_SDK_VERSION
##
## $(1): LOCAL_SDK_VERSION
###########################################################
define get-numeric-sdk-version
$(filter-out current,\
  $(if $(call has-system-sdk-version,$(1)),$(patsubst system_%,%,$(1)),$(1)))
endef
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ $(built_dpi_apk): PRIVATE_ASSET_DIR := $(LOCAL_ASSET_DIR)
$(built_dpi_apk): PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports)
$(built_dpi_apk): PRIVATE_RESOURCE_LIST := $(all_res_assets)
ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
$(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
$(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION))
else
$(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
endif
Loading