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
This commit is contained in:
Peter Collingbourne
2022-02-18 19:17:04 -08:00
parent c3ee009f38
commit 0e3b095886
2 changed files with 1 additions and 10 deletions

View File

@@ -142,11 +142,6 @@ $(KATI_obsolete_var ADDITIONAL_BUILD_PROPERTIES, Please use ADDITIONAL_SYSTEM_PR
#
# -----------------------------------------------------------------
# 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

View File

@@ -307,10 +307,6 @@ _prop_vars_ += \
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 @@ $(eval $(call build-properties,\
$(INSTALLED_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(_blacklist_names_),\
$(PRODUCT_SYSTEM_PROPERTY_BLACKLIST),\
$(empty),\
$(empty)))