Merge "Tune R8 shrinking defaults for system_server"

This commit is contained in:
Treehugger Robot 2022-08-02 17:21:18 +00:00 committed by Gerrit Code Review
commit 08a46cda1b

View file

@ -100,7 +100,20 @@ endif
# TODO(b/203088572): Remove when Java optimizations enabled by default for
# SystemUI.
$(call add_soong_config_var,ANDROID,SYSTEMUI_OPTIMIZE_JAVA)
# Enable by default unless explicitly set or overridden.
# See frameworks/base/services/Android.bp for additional notes on side effects.
SYSTEM_OPTIMIZE_JAVA ?= true
# Enable system_server optimizations by default unless explicitly set or if
# there may be dependent runtime jars.
# TODO(b/240588226): Remove the off-by-default exceptions after handling
# system_server jars automatically w/ R8.
ifeq (true,$(PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS))
# If system_server jar ordering is broken, don't assume services.jar can be
# safely optimized in isolation, as there may be dependent jars.
SYSTEM_OPTIMIZE_JAVA ?= false
else ifneq (platform:services,$(lastword $(PRODUCT_SYSTEM_SERVER_JARS)))
# If services is not the final jar in the dependency ordering, don't assume
# it can be safely optimized in isolation, as there may be dependent jars.
SYSTEM_OPTIMIZE_JAVA ?= false
else
SYSTEM_OPTIMIZE_JAVA ?= true
endif
$(call add_soong_config_var,ANDROID,SYSTEM_OPTIMIZE_JAVA)