From c87781a02080dfc3e43424918c41b168344735f0 Mon Sep 17 00:00:00 2001 From: Mohammad Samiul Islam Date: Wed, 25 Nov 2020 16:00:38 +0000 Subject: [PATCH] Add a product flag that will enable compressed APEX on device The product flag is only defined in this CL. No device has been configured to use this flag yet. The flag is overridable using environment variable. This way, developers can enable APEX compression on various targets. Bug: 137802149 Test: build/soong/soong_ui.bash --dumpvar-mode PRODUCT_COMPRESSED_APEX #false Test: export OVERRIDE_PRODUCT_COMPRESSED_APEX \ build/soong/soong_ui.bash --dumpvar-mode PRODUCT_COMPRESSED_APEX #true Change-Id: I10e4909258cee9b4670bc3f10ff3a0ad5013c864 --- core/product.mk | 3 +++ core/product_config.mk | 10 ++++++++++ core/soong_config.mk | 2 ++ 3 files changed, 15 insertions(+) diff --git a/core/product.mk b/core/product.mk index 5f06141ef..9aebc28d6 100644 --- a/core/product.mk +++ b/core/product.mk @@ -321,6 +321,9 @@ _product_single_value_vars += PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE # List of extra VNDK versions to be included _product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS +# Whether APEX should be compressed or not +_product_single_value_vars += PRODUCT_COMPRESSED_APEX + # VNDK version of product partition. It can be 'current' if the product # partitions uses PLATFORM_VNDK_VERSION. _product_single_value_vars += PRODUCT_PRODUCT_VNDK_VERSION diff --git a/core/product_config.mk b/core/product_config.mk index 6170b5b77..b9de8ca63 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -355,6 +355,16 @@ ifdef OVERRIDE_PRODUCT_EXTRA_VNDK_VERSIONS PRODUCT_EXTRA_VNDK_VERSIONS := $(OVERRIDE_PRODUCT_EXTRA_VNDK_VERSIONS) endif +########################################### +# APEXes are by default not compressed +# +# APEX compression can be forcibly enabled (resp. disabled) by +# setting OVERRIDE_PRODUCT_COMPRESSED_APEX to true (resp. false), e.g. by +# setting the OVERRIDE_PRODUCT_COMPRESSED_APEX environment variable. +ifdef OVERRIDE_PRODUCT_COMPRESSED_APEX + PRODUCT_COMPRESSED_APEX := $(OVERRIDE_PRODUCT_COMPRESSED_APEX) +endif + $(KATI_obsolete_var OVERRIDE_PRODUCT_EXTRA_VNDK_VERSIONS \ ,Use PRODUCT_EXTRA_VNDK_VERSIONS instead) diff --git a/core/soong_config.mk b/core/soong_config.mk index 06b55555a..8482ac691 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -212,6 +212,8 @@ $(call add_json_str, DeviceCurrentApiLevelForVendorModules, $(BOARD_CURRENT_AP $(call add_json_bool, InstallExtraFlattenedApexes, $(PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES)) +$(call add_json_bool, CompressedApex, $(PRODUCT_COMPRESSED_APEX)) + $(call add_json_bool, BoardUsesRecoveryAsBoot, $(BOARD_USES_RECOVERY_AS_BOOT)) $(call add_json_list, BoardKernelBinaries, $(BOARD_KERNEL_BINARIES))