Build system_ext build.prop with Soong
Bug: 322090587
Test: build and compare system_ext/etc/build.prop
Change-Id: I7b1af2e2b1fe7f107e1540d7b797c7bf489b8a0d
diff --git a/core/config.mk b/core/config.mk
index 75e072c..978c171 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1251,7 +1251,11 @@
TARGET_SYSTEM_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
endif
-.KATI_READONLY += TARGET_SYSTEM_PROP
+ifeq ($(TARGET_SYSTEM_EXT_PROP),)
+TARGET_SYSTEM_EXT_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop)
+endif
+
+.KATI_READONLY += TARGET_SYSTEM_PROP TARGET_SYSTEM_EXT_PROP
include $(BUILD_SYSTEM)/sysprop_config.mk
diff --git a/core/soong_config.mk b/core/soong_config.mk
index c3a4d07..5b764d0 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -348,6 +348,7 @@
$(call add_json_list, OemProperties, $(PRODUCT_OEM_PROPERTIES))
$(call add_json_list, SystemPropFiles, $(TARGET_SYSTEM_PROP))
+$(call add_json_list, SystemExtPropFiles, $(TARGET_SYSTEM_EXT_PROP))
# Do not set ArtTargetIncludeDebugBuild into any value if PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD is not set,
# to have the same behavior from runtime_libart.mk.
diff --git a/core/sysprop.mk b/core/sysprop.mk
index 12c97fe..9742a31 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -400,25 +400,10 @@
# -----------------------------------------------------------------
# system_ext/etc/build.prop
#
-_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
- $(TARGET_SYSTEM_EXT_PROP),\
- $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
-
-# Order matters here. When there are duplicates, the last one wins.
-# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
-_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
+# system_ext/build.prop is built by Soong. See system-build.prop module in
+# build/soong/Android.bp.
INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
-$(eval $(call build-properties,\
- system_ext,\
- $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
- $(_prop_files_),\
- $(_prop_vars_),\
- $(empty),\
- $(empty),\
- $(empty)))
-
-$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))
# ----------------------------------------------------------------
# ramdisk/boot/etc/build.prop
diff --git a/target/product/base_system_ext.mk b/target/product/base_system_ext.mk
index 92ca227..febe537 100644
--- a/target/product/base_system_ext.mk
+++ b/target/product/base_system_ext.mk
@@ -24,6 +24,7 @@
SatelliteClient \
selinux_policy_system_ext \
system_ext_manifest.xml \
+ system_ext-build.prop \
# Base modules when shipping api level is less than or equal to 34
PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \