Merge "Add fake_packages to the list of exceptions to INSTALLED_FILES_OUTSIDE_PACKAGES"
diff --git a/core/soong_config.mk b/core/soong_config.mk
index fd957c3..916dfbb 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -46,6 +46,7 @@
$(call add_json_bool, Eng, $(filter eng,$(TARGET_BUILD_VARIANT)))
$(call add_json_str, DeviceName, $(TARGET_DEVICE))
+$(call add_json_str, DeviceProduct, $(TARGET_PRODUCT))
$(call add_json_str, DeviceArch, $(TARGET_ARCH))
$(call add_json_str, DeviceArchVariant, $(TARGET_ARCH_VARIANT))
$(call add_json_str, DeviceCpuVariant, $(TARGET_CPU_VARIANT))
diff --git a/target/product/virtual_ab_ota/android_t_baseline.mk b/target/product/virtual_ab_ota/android_t_baseline.mk
index f2639b4..18e08e4 100644
--- a/target/product/virtual_ab_ota/android_t_baseline.mk
+++ b/target/product/virtual_ab_ota/android_t_baseline.mk
@@ -37,5 +37,16 @@
PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD ?= none
PRODUCT_PACKAGES += \
snapuserd \
- snapuserd.recovery \
+
+# For dedicated recovery partitions, we need to include snapuserd
+# For GKI devices, BOARD_USES_RECOVERY_AS_BOOT is empty, but
+# so is BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT.
+ifdef BUILDING_RECOVERY_IMAGE
+ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
+ifneq ($(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT),true)
+PRODUCT_PACKAGES += \
+ snapuserd.recovery
+endif
+endif
+endif