Merge "Add LOCAL_EXPORT_CFLAGS for Soong" into oc-dev
diff --git a/core/Makefile b/core/Makefile
index 2a031ea..755f3bb 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -900,6 +900,10 @@
     $(ALL_MODULES.fs_config_dirs.INSTALLED) \
     $(ALL_MODULES.fs_config_files.INSTALLED) \
 
+ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
+INTERNAL_USERIMAGES_DEPS += $(MKE2FS_CONF)
+endif
+
 # $(1): the path of the output dictionary file
 # $(2): additional "key=value" pairs to append to the dictionary file.
 define generate-userimage-prop-dictionary
@@ -1931,10 +1935,11 @@
 $(BUILT_OTATOOLS_PACKAGE): $(OTATOOLS) | $(ACP)
 	@echo "Package OTA tools: $@"
 	$(hide) rm -rf $@ $(zip_root)
-	$(hide) mkdir -p $(dir $@) $(zip_root)/bin $(zip_root)/framework $(zip_root)/releasetools $(zip_root)/system/extras/verity
+	$(hide) mkdir -p $(dir $@) $(zip_root)/bin $(zip_root)/framework $(zip_root)/releasetools $(zip_root)/system/extras/verity $(zip_root)/system/extras/ext4_utils
 	$(call copy-files-with-structure,$(OTATOOLS),$(HOST_OUT)/,$(zip_root))
 	$(hide) $(ACP) $(HOST_OUT_JAVA_LIBRARIES)/VeritySigner.jar $(zip_root)/framework/
 	$(hide) $(ACP) -p system/extras/verity/build_verity_metadata.py $(zip_root)/system/extras/verity/
+	$(hide) $(ACP) -p system/extras/ext4_utils/mke2fs.conf $(zip_root)/system/extras/ext4_utils/
 	$(hide) $(ACP) -r -d -p build/tools/releasetools/* $(zip_root)/releasetools
 ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT))
 	$(hide) mkdir -p $(zip_root)/external/vboot_reference/tests/devkeys
diff --git a/core/config.mk b/core/config.mk
index f033ad9..863416e 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -588,9 +588,11 @@
 ifeq ($(TARGET_USES_MKE2FS),true)
 MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX)
 MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs.sh
+MKE2FS_CONF := system/extras/ext4_utils/mke2fs.conf
 else
 MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/make_ext4fs$(HOST_EXECUTABLE_SUFFIX)
 MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg.sh
+MKE2FS_CONF :=
 endif
 BLK_ALLOC_TO_BASE_FS := $(HOST_OUT_EXECUTABLES)/blk_alloc_to_base_fs$(HOST_EXECUTABLE_SUFFIX)
 MAKE_SQUASHFS := $(HOST_OUT_EXECUTABLES)/mksquashfs$(HOST_EXECUTABLE_SUFFIX)
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 4d8e2d2..69b0230 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -152,10 +152,15 @@
 endif
 endif
 
-# Jars of system server, and apps loaded into system server should be
-# compiled with the 'speed' compiler filter.
 ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
+  # Jars of system server, and apps loaded into system server should be
+  # compiled with the 'speed' compiler filter.
   LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
+else
+  # If no compiler filter is specified, default to 'interpret-only' to save on storage.
+  ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS)))
+    LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=interpret-only
+  endif
 endif
 
 $(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 04bfe49..880d310 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -221,11 +221,6 @@
   $(error Use `MALLOC_SVELTE := true` to configure jemalloc for low-memory)
 endif
 TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
-ifneq ($(ENABLE_TREBLE),true)
-ifneq ($(BOARD_WRAPS_CONVENTIONAL_HALS),)
-$(error BOARD_WRAPS_CONVENTIONAL_HALS cannot be defined when ENABLE_TREBLE is not set to true)
-endif
-endif
 board_config_mk :=
 
 ###########################################
diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk
index 4c57f31..2c3821a 100644
--- a/target/board/generic_arm64_ab/BoardConfig.mk
+++ b/target/board/generic_arm64_ab/BoardConfig.mk
@@ -47,12 +47,6 @@
 # Generic AOSP image does NOT support HWC1
 TARGET_USES_HWC2 := true
 
-# TODO(jiyong): Remove these two. These are required in order to remove
-# board-specific sysprops from system.img. This should be replaced with
-# a more meaningful build flags such as BOARD_SYSPROP_SPLIT.
-ENABLE_TREBLE := true
-BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
-
 TARGET_ARCH := arm64
 TARGET_ARCH_VARIANT := armv8-a
 TARGET_CPU_ABI := arm64-v8a
diff --git a/target/product/embedded.mk b/target/product/embedded.mk
index cfca2c4..8115385 100644
--- a/target/product/embedded.mk
+++ b/target/product/embedded.mk
@@ -84,6 +84,7 @@
     toolbox \
     toybox \
     tzdatacheck \
+    vndservicemanager \
 
 # SELinux packages
 PRODUCT_PACKAGES += \
@@ -95,7 +96,8 @@
     plat_property_contexts \
     plat_seapp_contexts \
     plat_service_contexts \
-    selinux_policy
+    selinux_policy \
+    vndservice_contexts
 
 # AID Generation for
 # <pwd.h> and <grp.h>