1# ADDITIONAL_<partition>_PROPERTIES are properties that are determined by the
2# build system itself. Don't let it be defined from outside of the core build
3# system like Android.mk or <product>.mk files.
4_additional_prop_var_names := \
5    ADDITIONAL_SYSTEM_PROPERTIES \
6    ADDITIONAL_VENDOR_PROPERTIES \
7    ADDITIONAL_ODM_PROPERTIES \
8    ADDITIONAL_PRODUCT_PROPERTIES
9
10$(foreach name, $(_additional_prop_var_names),\
11  $(if $($(name)),\
12    $(error $(name) must not set before here. $($(name)))\
13  ,)\
14  $(eval $(name) :=)\
15)
16_additional_prop_var_names :=
17
18#
19# -----------------------------------------------------------------
20# Add the product-defined properties to the build properties.
21ifneq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
22  ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
23else
24  ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
25    ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
26  endif
27endif
28
29ADDITIONAL_SYSTEM_PROPERTIES += ro.treble.enabled=${PRODUCT_FULL_TREBLE}
30
31# Set ro.llndk.api_level to show the maximum vendor API level that the LLNDK in
32# the system partition supports.
33ifdef RELEASE_BOARD_API_LEVEL
34ADDITIONAL_SYSTEM_PROPERTIES += ro.llndk.api_level=$(RELEASE_BOARD_API_LEVEL)
35endif
36
37# Sets ro.actionable_compatible_property.enabled to know on runtime whether the
38# allowed list of actionable compatible properties is enabled or not.
39ADDITIONAL_SYSTEM_PROPERTIES += ro.actionable_compatible_property.enabled=true
40
41# Add the system server compiler filter if they are specified for the product.
42ifneq (,$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
43ADDITIONAL_PRODUCT_PROPERTIES += dalvik.vm.systemservercompilerfilter=$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)
44endif
45
46# Add the 16K developer option if it is defined for the product.
47ifeq ($(PRODUCT_16K_DEVELOPER_OPTION),true)
48ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=true
49else
50ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=false
51endif
52
53# Enable core platform API violation warnings on userdebug and eng builds.
54ifneq ($(TARGET_BUILD_VARIANT),user)
55ADDITIONAL_SYSTEM_PROPERTIES += persist.debug.dalvik.vm.core_platform_api_policy=just-warn
56endif
57
58# Define ro.sanitize.<name> properties for all global sanitizers.
59ADDITIONAL_SYSTEM_PROPERTIES += $(foreach s,$(SANITIZE_TARGET),ro.sanitize.$(s)=true)
60
61# Sets the default value of ro.postinstall.fstab.prefix to /system.
62# Device board config should override the value to /product when needed by:
63#
64#     PRODUCT_PRODUCT_PROPERTIES += ro.postinstall.fstab.prefix=/product
65#
66# It then uses ${ro.postinstall.fstab.prefix}/etc/fstab.postinstall to
67# mount system_other partition.
68ADDITIONAL_SYSTEM_PROPERTIES += ro.postinstall.fstab.prefix=/system
69
70# Add cpu properties for bionic and ART.
71ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.arch=$(TARGET_ARCH)
72ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.cpu_variant=$(TARGET_CPU_VARIANT_RUNTIME)
73ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.2nd_arch=$(TARGET_2ND_ARCH)
74ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.2nd_cpu_variant=$(TARGET_2ND_CPU_VARIANT_RUNTIME)
75
76ADDITIONAL_VENDOR_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart.so
77ADDITIONAL_VENDOR_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT_RUNTIME)
78ifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),)
79  ADDITIONAL_VENDOR_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
80endif
81
82ifdef TARGET_2ND_ARCH
83  ADDITIONAL_VENDOR_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).variant=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT_RUNTIME)
84  ifneq ($($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),)
85    ADDITIONAL_VENDOR_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).features=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
86  endif
87endif
88
89# Although these variables are prefixed with TARGET_RECOVERY_, they are also needed under charger
90# mode (via libminui).
91ifdef TARGET_RECOVERY_DEFAULT_ROTATION
92ADDITIONAL_VENDOR_PROPERTIES += \
93    ro.minui.default_rotation=$(TARGET_RECOVERY_DEFAULT_ROTATION)
94endif
95ifdef TARGET_RECOVERY_OVERSCAN_PERCENT
96ADDITIONAL_VENDOR_PROPERTIES += \
97    ro.minui.overscan_percent=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
98endif
99ifdef TARGET_RECOVERY_PIXEL_FORMAT
100ADDITIONAL_VENDOR_PROPERTIES += \
101    ro.minui.pixel_format=$(TARGET_RECOVERY_PIXEL_FORMAT)
102endif
103
104ifdef PRODUCT_USE_DYNAMIC_PARTITIONS
105ADDITIONAL_VENDOR_PROPERTIES += \
106    ro.boot.dynamic_partitions=$(PRODUCT_USE_DYNAMIC_PARTITIONS)
107endif
108
109ifdef PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
110ADDITIONAL_VENDOR_PROPERTIES += \
111    ro.boot.dynamic_partitions_retrofit=$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)
112endif
113
114ifdef PRODUCT_SHIPPING_API_LEVEL
115ADDITIONAL_VENDOR_PROPERTIES += \
116    ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
117endif
118
119ifdef PRODUCT_SHIPPING_VENDOR_API_LEVEL
120ADDITIONAL_VENDOR_PROPERTIES += \
121    ro.vendor.api_level=$(PRODUCT_SHIPPING_VENDOR_API_LEVEL)
122endif
123
124ifneq ($(TARGET_BUILD_VARIANT),user)
125  ifdef PRODUCT_SET_DEBUGFS_RESTRICTIONS
126    ADDITIONAL_VENDOR_PROPERTIES += \
127      ro.product.debugfs_restrictions.enabled=$(PRODUCT_SET_DEBUGFS_RESTRICTIONS)
128  endif
129endif
130
131# Vendors with GRF must define BOARD_SHIPPING_API_LEVEL for the vendor API level.
132# This must not be defined for the non-GRF devices.
133# The values of the GRF properties will be verified by post_process_props.py
134ifdef BOARD_SHIPPING_API_LEVEL
135ADDITIONAL_VENDOR_PROPERTIES += \
136    ro.board.first_api_level=$(BOARD_SHIPPING_API_LEVEL)
137endif
138
139# Build system set BOARD_API_LEVEL to show the api level of the vendor API surface.
140# This must not be altered outside of build system.
141ifdef BOARD_API_LEVEL
142ADDITIONAL_VENDOR_PROPERTIES += \
143    ro.board.api_level=$(BOARD_API_LEVEL)
144endif
145# RELEASE_BOARD_API_LEVEL_FROZEN is true when the vendor API surface is frozen.
146ifdef RELEASE_BOARD_API_LEVEL_FROZEN
147ADDITIONAL_VENDOR_PROPERTIES += \
148    ro.board.api_frozen=$(RELEASE_BOARD_API_LEVEL_FROZEN)
149endif
150
151# Set build prop. This prop is read by ota_from_target_files when generating OTA,
152# to decide if VABC should be disabled.
153ifeq ($(BOARD_DONT_USE_VABC_OTA),true)
154ADDITIONAL_VENDOR_PROPERTIES += \
155    ro.vendor.build.dont_use_vabc=true
156endif
157
158# Set the flag in vendor. So VTS would know if the new fingerprint format is in use when
159# the system images are replaced by GSI.
160ifeq ($(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT),true)
161ADDITIONAL_VENDOR_PROPERTIES += \
162    ro.vendor.build.fingerprint_has_digest=1
163endif
164
165ADDITIONAL_VENDOR_PROPERTIES += \
166    ro.vendor.build.security_patch=$(VENDOR_SECURITY_PATCH) \
167    ro.product.board=$(TARGET_BOOTLOADER_BOARD_NAME) \
168    ro.board.platform=$(TARGET_BOARD_PLATFORM) \
169    ro.hwui.use_vulkan=$(TARGET_USES_VULKAN)
170
171ifdef TARGET_SCREEN_DENSITY
172ADDITIONAL_VENDOR_PROPERTIES += \
173    ro.sf.lcd_density=$(TARGET_SCREEN_DENSITY)
174endif
175
176ifdef AB_OTA_UPDATER
177ADDITIONAL_VENDOR_PROPERTIES += \
178    ro.build.ab_update=$(AB_OTA_UPDATER)
179endif
180
181ADDITIONAL_PRODUCT_PROPERTIES += ro.build.characteristics=$(TARGET_AAPT_CHARACTERISTICS)
182
183ifeq ($(AB_OTA_UPDATER),true)
184ADDITIONAL_PRODUCT_PROPERTIES += ro.product.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
185ADDITIONAL_VENDOR_PROPERTIES += ro.vendor.build.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
186endif
187
188# Set this property for VTS to skip large page size tests on unsupported devices.
189ADDITIONAL_PRODUCT_PROPERTIES += \
190    ro.product.cpu.pagesize.max=$(TARGET_MAX_PAGE_SIZE_SUPPORTED)
191
192ifeq ($(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO),true)
193ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.no_bionic_page_size_macro=true
194endif
195
196user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
197enable_target_debugging := true
198enable_dalvik_lock_contention_logging := true
199ifneq (,$(user_variant))
200  # Target is secure in user builds.
201  ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=1
202  ADDITIONAL_SYSTEM_PROPERTIES += security.perf_harden=1
203
204  ifeq ($(user_variant),user)
205    ADDITIONAL_SYSTEM_PROPERTIES += ro.adb.secure=1
206  endif
207
208  ifneq ($(user_variant),userdebug)
209    # Disable debugging in plain user builds.
210    enable_target_debugging :=
211    enable_dalvik_lock_contention_logging :=
212  else
213    # Disable debugging in userdebug builds if PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG
214    # is set.
215    ifneq (,$(strip $(PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG)))
216      enable_target_debugging :=
217    endif
218  endif
219
220  # Disallow mock locations by default for user builds
221  ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=0
222
223else # !user_variant
224  # Turn on checkjni for non-user builds.
225  ADDITIONAL_SYSTEM_PROPERTIES += ro.kernel.android.checkjni=1
226  # Set device insecure for non-user builds.
227  ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=0
228  # Allow mock locations by default for non user builds
229  ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=1
230endif # !user_variant
231
232ifeq (true,$(strip $(enable_dalvik_lock_contention_logging)))
233  # Enable Dalvik lock contention logging.
234  ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.lockprof.threshold=500
235endif # !enable_dalvik_lock_contention_logging
236
237ifeq (true,$(strip $(enable_target_debugging)))
238  # Target is more debuggable and adbd is on by default
239  ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=1
240else # !enable_target_debugging
241  # Target is less debuggable and adbd is off by default
242  ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=0
243endif # !enable_target_debugging
244
245enable_target_debugging:=
246enable_dalvik_lock_contention_logging:=
247
248ifneq ($(filter sdk sdk_addon,$(MAKECMDGOALS)),)
249_is_sdk_build := true
250endif
251
252ifeq ($(TARGET_BUILD_VARIANT),eng)
253ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))),)
254  # Don't require the setup wizard on eng builds
255  ADDITIONAL_SYSTEM_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
256          $(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))) \
257          ro.setupwizard.mode=OPTIONAL
258endif
259ifndef _is_sdk_build
260  # To speedup startup of non-preopted builds, don't verify or compile the boot image.
261  ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.image-dex2oat-filter=extract
262endif
263# b/323566535
264ADDITIONAL_SYSTEM_PROPERTIES += init.svc_debug.no_fatal.zygote=true
265endif
266
267ifdef _is_sdk_build
268ADDITIONAL_SYSTEM_PROPERTIES += xmpp.auto-presence=true
269ADDITIONAL_SYSTEM_PROPERTIES += ro.config.nocheckin=yes
270endif
271
272_is_sdk_build :=
273
274ADDITIONAL_SYSTEM_PROPERTIES += net.bt.name=Android
275
276# This property is set by flashing debug boot image, so default to false.
277ADDITIONAL_SYSTEM_PROPERTIES += ro.force.debuggable=0
278
279config_enable_uffd_gc := \
280  $(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default)
281
282# This is a temporary system property that controls the ART module. The plan is
283# to remove it by Aug 2025, at which time Mainline updates of the ART module
284# will ignore it as well.
285# If the value is "default", it will be mangled by post_process_props.py.
286ADDITIONAL_PRODUCT_PROPERTIES += ro.dalvik.vm.enable_uffd_gc=$(config_enable_uffd_gc)
287
288ADDITIONAL_SYSTEM_PROPERTIES := $(strip $(ADDITIONAL_SYSTEM_PROPERTIES))
289ADDITIONAL_PRODUCT_PROPERTIES := $(strip $(ADDITIONAL_PRODUCT_PROPERTIES))
290ADDITIONAL_VENDOR_PROPERTIES := $(strip $(ADDITIONAL_VENDOR_PROPERTIES))
291
292.KATI_READONLY += \
293    ADDITIONAL_SYSTEM_PROPERTIES \
294    ADDITIONAL_PRODUCT_PROPERTIES \
295    ADDITIONAL_VENDOR_PROPERTIES
296