Change how we set ro.product.first_api_level.
The goal of this change is to cause ro.product.first_api_level to be
set in /system/build.prop in targets with PRODUCT_FULL_TREBLE=false
(which may be the case for targets without the usual set of
hardware interfaces, such as the mini targets being added in
https://r.android.com/1966051).
Setting ro.product.first_api_level is necessary for devices with newer
kernels to boot because it controls which metadata encryption format
is used, and an old format that is incompatible with new kernels is
used by default (see commit 4073c0b5241b635cb59e9e8a75ddcc783b5a99ce in
system/vold). There also appear to be e.g. bionic tests that check this
property. So it seems reasonable to set it even if PRODUCT_FULL_TREBLE
is false.
To begin with, stop adding it to ADDITIONAL_SYSTEM_PROPERTIES. There's
basically no point in adding it there because it will be filtered
out by the property blocklist for the system partition, whether
PRODUCT_FULL_TREBLE is true or false. This lets us remove the
blocklist entry, which causes ro.product.first_api_level to
appear in /system/build.prop via ADDITIONAL_VENDOR_PROPERTIES on
PRODUCT_FULL_TREBLE=false targets.
Bug: 217455793
Change-Id: I8c07baf9d308ea734ffed5d9b1776b60cdbf3435
diff --git a/core/main.mk b/core/main.mk
index e9cbc60..47666c1 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -142,11 +142,6 @@
#
# -----------------------------------------------------------------
# Add the product-defined properties to the build properties.
-ifdef PRODUCT_SHIPPING_API_LEVEL
-ADDITIONAL_SYSTEM_PROPERTIES += \
- ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
-endif
-
ifneq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
else
diff --git a/core/sysprop.mk b/core/sysprop.mk
index 86435d96..9febe11 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -307,10 +307,6 @@
PRODUCT_VENDOR_PROPERTIES
endif
-_blacklist_names_ := \
- $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \
- ro.product.first_api_level
-
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
$(eval $(call build-properties,\
@@ -318,7 +314,7 @@
$(INSTALLED_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
- $(_blacklist_names_),\
+ $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST),\
$(empty),\
$(empty)))