Fix loophole in module expansion.
Previously we only expanded product_MODULES with LOCAL_REQUIRED_MODULES, but not modules introduced by LOCAL_SHARED_LIBRARIES; Later we did a further shared libary expansion in vendor_module_check.mk. It couldn't track C in the following case: A : B, by LOCAL_SHARED_LIBRARIES; B : C, by LOCAL_REQUIRED_MODULES. With this change, we transformed the LOCAL_SHARED_LIBRARIES dependencies into LOCAL_REQUIRED_MODULES dependencies before doing the required module expansion and the loophole is closed. All module names are now expanded to product_MODULES now and it makes vendor_module_check.mk simpler. Change-Id: I8835a478d2ce0ce10601a8449f446f07b01c2b7f
This commit is contained in:
@@ -38,20 +38,7 @@ _vendor_owner_whitelist := \
|
||||
|
||||
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
|
||||
|
||||
_vendor_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
|
||||
$(call expand-required-modules,_vendor_check_modules,$(_vendor_check_modules))
|
||||
|
||||
# Expand the target modules installed via LOCAL_SHARED_LIBRARIES
|
||||
# $(1): the list of modules to expand.
|
||||
define expand-required-shared-libraries
|
||||
$(eval _ersl_new_modules := $(filter $(addsuffix :%,$(1)),$(TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES)))\
|
||||
$(eval _ersl_new_modules := $(foreach p,$(_ersl_new_modules),$(word 3,$(subst :,$(space),$(p)))))\
|
||||
$(eval _ersl_new_modules := $(sort $(subst $(comma),$(space),$(_ersl_new_modules))))\
|
||||
$(eval _ersl_new_modules := $(filter-out $(_vendor_check_modules),$(_ersl_new_modules)))\
|
||||
$(if $(_ersl_new_modules),$(eval _vendor_check_modules += $(_ersl_new_modules))\
|
||||
$(call expand-required-shared-libraries,$(_ersl_new_modules)))
|
||||
endef
|
||||
$(call expand-required-shared-libraries,$(_vendor_check_modules))
|
||||
_vendor_check_modules := $(product_MODULES)
|
||||
|
||||
_vendor_module_owner_info :=
|
||||
# Restrict owners
|
||||
|
Reference in New Issue
Block a user