Merge "Re-submit "Make mainline device use apex"" am: 491966fb7f
am: db7529d009

Change-Id: I0a927fd611c962f6b6f5a3c2e5f9e869829c2df6
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 3430346..bdd16d5 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -680,6 +680,8 @@
 # Change file layout of system_other
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system_other)
 
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/apex)
+
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/target/board/mainline_arm64/BoardConfig.mk b/target/board/mainline_arm64/BoardConfig.mk
index 70505f4..ea2b3c5 100644
--- a/target/board/mainline_arm64/BoardConfig.mk
+++ b/target/board/mainline_arm64/BoardConfig.mk
@@ -34,3 +34,8 @@
 
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
+
+# Mainline devices support apex
+# TODO: move this to BoardConfigMainlineCommon. Currently, GSI wants flattened
+#       apexes, but emulator wants .apex files, preventing this.
+TARGET_FLATTEN_APEX := false