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

Commit b8d3cc02 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Allow custom compiler filters for system server jars

Passing down a compiler filter in LOCAL_DEX_PREOPT_FLAGS or
PRODUCT_DEX_PREOPT_DEFAULT_FLAGS will no longer always get
overridden to speed.

Bug: 62356545
Test: make and flash

Change-Id: I8b777c8881cba6b11cda56d27f0a714c92d70d94
parent beb834d3
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -175,17 +175,17 @@ LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
endif
endif
endif
endif


ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS)))
  ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
  ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
  # Jars of system server, apps loaded into system server, and apps the product wants to be
    # Jars of system server, apps loaded into system server, and apps the product default to being
    # compiled with the 'speed' compiler filter.
    # compiled with the 'speed' compiler filter.
    LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
    LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
  else
  else
  # If no compiler filter is specified, default to 'quicken' to save on storage.
  ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS)))
    ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
    ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
      # For non system server jars, use speed-profile when we have a profile.
      # For non system server jars, use speed-profile when we have a profile.
      LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile
      LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile
    else
    else
      # If no compiler filter is specified, default to 'quicken' to save on storage.
      LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken
      LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken
    endif
    endif
  endif
  endif