Determine whether to enable userfaultfd GC at build time.

This is determined by:
- a product config flag
- the vendor API level

It is then passed to the device as a system property
"ro.dalvik.vm.enable_uffd_gc".

This change is a no-op change. It doesn't enable userfaultfd GC by
default. OVERRIDE_ENABLE_UFFD_GC=default can be passed to the build
system to enable userfaultfd GC for testing purposes.

Bug: 242553398
Test: -
  1. lunch aosp_redfin-userdebug
  2. OVERRIDE_ENABLE_UFFD_GC=default build/soong/soong_ui.bash --dumpvars-mode --vars=ENABLE_UFFD_GC
  3. See "false" in the output
Test: -
  1. lunch aosp_oriole-userdebug
  2. OVERRIDE_ENABLE_UFFD_GC=default build/soong/soong_ui.bash --dumpvars-mode --vars=ENABLE_UFFD_GC
  3. See "true" in the output
Test: -
  1. lunch aosp_redfin-userdebug
  2. OVERRIDE_ENABLE_UFFD_GC=true build/soong/soong_ui.bash --dumpvars-mode --vars=ENABLE_UFFD_GC
  3. See "true" in the output
Test: -
  1. lunch aosp_oriole-userdebug
  2. OVERRIDE_ENABLE_UFFD_GC=false build/soong/soong_ui.bash --dumpvars-mode --vars=ENABLE_UFFD_GC
  3. See "false" in the output
Change-Id: Ifd6e6cddb502315912ff949619a5b526ae0d73ff
diff --git a/core/product.mk b/core/product.mk
index dcfdf1f..4c642b8 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -370,6 +370,18 @@
 # If true, installs a full version of com.android.virt APEX.
 _product_single_value_vars += PRODUCT_AVF_ENABLED
 
+# Whether to use userfaultfd GC.
+# Possible values are:
+# - "default" or empty: both the build system and the runtime determine whether to use userfaultfd
+#   GC based on the vendor API level
+# - "true": forces the build system to use userfaultfd GC regardless of the vendor API level; the
+#   runtime determines whether to use userfaultfd GC based on the kernel support. Note that the
+#   device may have to re-compile everything on the first boot if the kernel doesn't support
+#   userfaultfd
+# - "false": disallows the build system and the runtime to use userfaultfd GC even if the device
+#   supports it
+_product_single_value_vars += PRODUCT_ENABLE_UFFD_GC
+
 .KATI_READONLY := _product_single_value_vars _product_list_vars
 _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)