Add comments and slight refactor auto-RRO logic

Make it a bit clearer what this code is intended to do.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Ic405fc5d4601b9f0a91b4d24caa06f279267c51a
This commit is contained in:
Anton Hansson 2019-03-14 18:53:58 +00:00
parent c6bf520424
commit fd06b02b30
1 changed files with 18 additions and 23 deletions

View File

@ -116,31 +116,26 @@ package_resource_overlays := $(strip \
$(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR))))) $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))))
enforce_rro_enabled := enforce_rro_enabled :=
ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) ifneq ($(package_resource_overlays),)
ifneq ($(package_resource_overlays),) ifeq ($(PRODUCT_ENFORCE_RRO_TARGETS),*)
ifeq ($(PRODUCT_ENFORCE_RRO_TARGETS),*) # * means all system APKs, so enable conditionally based on module path.
enforce_rro_enabled := true
else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS)))
enforce_rro_enabled := true
endif
endif
ifdef enforce_rro_enabled # Note that base_rules.mk has not yet been included, so it's likely that only
# one of LOCAL_MODULE_PATH and the LOCAL_X_MODULE flags has been set.
ifeq (,$(LOCAL_MODULE_PATH)) ifeq (,$(LOCAL_MODULE_PATH))
ifeq (true,$(LOCAL_PROPRIETARY_MODULE)) non_system_module := $(filter true,\
enforce_rro_enabled := $(LOCAL_ODM_MODULE) \
else ifeq (true,$(LOCAL_OEM_MODULE)) $(LOCAL_OEM_MODULE) \
enforce_rro_enabled := $(LOCAL_PRODUCT_MODULE) \
else ifeq (true,$(LOCAL_ODM_MODULE)) $(LOCAL_PRODUCT_SERVICES_MODULE) \
enforce_rro_enabled := $(LOCAL_PROPRIETARY_MODULE) \
else ifeq (true,$(LOCAL_PRODUCT_MODULE)) $(LOCAL_VENDOR_MODULE))
enforce_rro_enabled := enforce_rro_enabled := $(if $(non_system_module),,true)
else ifeq (true,$(LOCAL_PRODUCT_SERVICES_MODULE)) else ifneq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),)
enforce_rro_enabled := enforce_rro_enabled := true
endif
else ifeq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),)
enforce_rro_enabled :=
endif endif
else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS)))
enforce_rro_enabled := true
endif endif
endif endif
@ -156,7 +151,7 @@ ifdef enforce_rro_enabled
endif endif
endif endif
else else
LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
endif endif
all_assets := $(strip \ all_assets := $(strip \