diff --git a/core/config.mk b/core/config.mk index 86fc3997b..aaeda70df 100644 --- a/core/config.mk +++ b/core/config.mk @@ -700,6 +700,25 @@ else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),26),) PRODUCT_FULL_TREBLE := true endif +requirements := \ + PRODUCT_TREBLE_LINKER_NAMESPACES \ + PRODUCT_SEPOLICY_SPLIT \ + PRODUCT_ENFORCE_VINTF_MANIFEST \ + +# If it is overriden, then the requirement override is taken, otherwise it's +# PRODUCT_FULL_TREBLE +$(foreach req,$(requirements),$(eval \ + $(req) := $(if $($(req)_OVERRIDE),$($(req)_OVERRIDE),$(PRODUCT_FULL_TREBLE)))) +# If the requirement is false for any reason, then it's not PRODUCT_FULL_TREBLE +$(foreach req,$(requirements),$(eval \ + PRODUCT_FULL_TREBLE := $(if $(filter false,$($(req))),false,$(PRODUCT_FULL_TREBLE)))) + +.KATI_READONLY := \ + $(requirements) \ + PRODUCT_FULL_TREBLE + +requirements := + # The default key if not set as LOCAL_CERTIFICATE ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE) diff --git a/target/board/Android.mk b/target/board/Android.mk index c5678d1c4..4b5af3c40 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -78,9 +78,7 @@ GEN := $(local-generated-sources-dir)/manifest.xml $(GEN): PRIVATE_FLAGS := -# TODO(b/37954458), (b/37321309) remove check of PRODUCT_FULL_TREBLE after -# putting device compatibility matrices for non-treble devices. -ifeq ($(PRODUCT_FULL_TREBLE),true) +ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true) ifdef BUILT_VENDOR_MATRIX $(GEN): $(BUILT_VENDOR_MATRIX) $(GEN): PRIVATE_FLAGS += -c "$(BUILT_VENDOR_MATRIX)" @@ -105,9 +103,7 @@ GEN := $(local-generated-sources-dir)/compatibility_matrix.xml $(GEN): PRIVATE_FLAGS := -# TODO(b/37954458), (b/37321309) remove check of PRODUCT_FULL_TREBLE after -# putting complete HAL manifests on non-treble devices. -ifeq ($(PRODUCT_FULL_TREBLE),true) +ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true) ifdef BUILT_VENDOR_MANIFEST $(GEN): $(BUILT_VENDOR_MANIFEST) $(GEN): PRIVATE_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)"