From bbaa5efbbc08202172806b7e89525635358f836b Mon Sep 17 00:00:00 2001 From: tyiu Date: Fri, 27 Oct 2023 00:08:32 +0000 Subject: [PATCH] Add config for FULL_SYSTEM_OPTIMIZE_JAVA FULL_SYSTEM_OPTIMIZE_JAVA allows device to enable full system java optimization. Bug: 300514883 Test: local m Change-Id: Iba0a546ef2b721b929b791c6a9e6c854e9bec909 Merged-In: Iba0a546ef2b721b929b791c6a9e6c854e9bec909 --- core/android_soong_config_vars.mk | 6 ++++++ core/config.mk | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index 6d64f97780..c8c33899dc 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -180,7 +180,13 @@ else ifneq (platform:services,$(lastword $(PRODUCT_SYSTEM_SERVER_JARS))) else SYSTEM_OPTIMIZE_JAVA ?= true endif + +ifeq (true,$(FULL_SYSTEM_OPTIMIZE_JAVA)) + SYSTEM_OPTIMIZE_JAVA := true +endif + $(call add_soong_config_var,ANDROID,SYSTEM_OPTIMIZE_JAVA) +$(call add_soong_config_var,ANDROID,FULL_SYSTEM_OPTIMIZE_JAVA) # Check for SupplementalApi module. ifeq ($(wildcard packages/modules/SupplementalApi),) diff --git a/core/config.mk b/core/config.mk index c747fd5fb3..dd780eba29 100644 --- a/core/config.mk +++ b/core/config.mk @@ -1309,3 +1309,9 @@ DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages) .KATI_READONLY := DEFAULT_DATA_OUT_MODULES include $(BUILD_SYSTEM)/dumpvar.mk + +ifeq (true,$(FULL_SYSTEM_OPTIMIZE_JAVA)) +ifeq (,$(SYSTEM_OPTIMIZE_JAVA)) +$(error SYSTEM_OPTIMIZE_JAVA must be enabled when FULL_SYSTEM_OPTIMIZE_JAVA is enabled) +endif +endif