diff --git a/core/config.mk b/core/config.mk index f3471099c..dbdd2861f 100644 --- a/core/config.mk +++ b/core/config.mk @@ -743,6 +743,19 @@ APICHECK_CLASSPATH := $(subst $(space),:,$(strip $(APICHECK_CLASSPATH_ENTRIES))) APICHECK_COMMAND := $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)" +# Boolean variable determining if the whitelist for compatible properties is enabled +PRODUCT_COMPATIBLE_PROPERTY := false +ifneq ($(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE),) + PRODUCT_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE) +else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),) + #$(warning no product shipping level defined) +else ifneq ($(call math_lt,27,$(PRODUCT_SHIPPING_API_LEVEL)),) + PRODUCT_COMPATIBLE_PROPERTY := true +endif + +.KATI_READONLY := \ + PRODUCT_COMPATIBLE_PROPERTY + # Boolean variable determining if Treble is fully enabled PRODUCT_FULL_TREBLE := false ifneq ($(PRODUCT_FULL_TREBLE_OVERRIDE),) diff --git a/core/main.mk b/core/main.mk index c8d1bacff..158b291a5 100644 --- a/core/main.mk +++ b/core/main.mk @@ -207,6 +207,14 @@ $(KATI_obsolete_var PRODUCT_FULL_TREBLE,\ variables like PRODUCT_SEPOLICY_SPLIT should be used until that is \ possible.) +# Sets ro.actionable_compatible_property.enabled to know on runtime whether the whitelist +# of actionable compatible properties is enabled or not. +ifeq ($(PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE),true) +ADDITIONAL_DEFAULT_PROPERTIES += ro.actionable_compatible_property.enabled=false +else +ADDITIONAL_DEFAULT_PROPERTIES += ro.actionable_compatible_property.enabled=${PRODUCT_COMPATIBLE_PROPERTY} +endif + # ----------------------------------------------------------------- ### ### In this section we set up the things that are different diff --git a/core/product.mk b/core/product.mk index f15f6b370..77f78a67f 100644 --- a/core/product.mk +++ b/core/product.mk @@ -149,6 +149,8 @@ _product_var_list := \ PRODUCT_ADB_KEYS \ PRODUCT_CFI_INCLUDE_PATHS \ PRODUCT_CFI_EXCLUDE_PATHS \ + PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE \ + PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE \ define dump-product $(info ==== $(1) ====)\ diff --git a/core/product_config.mk b/core/product_config.mk index 5b0e2574e..2cd801633 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -484,3 +484,11 @@ PRODUCT_CFI_INCLUDE_PATHS := \ # which Soong namespaces to export to Make PRODUCT_SOONG_NAMESPACES := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SOONG_NAMESPACES)) + +# A flag to override PRODUCT_COMPATIBLE_PROPERTY +PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE)) + +# Whether the whitelist of actionable compatible properties should be disabled or not +PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE))