Merge "Handle virtual A/B defines during dynamic_partitions_info merge."
diff --git a/core/copy_headers.mk b/core/copy_headers.mk
index c26d51d..054d271 100644
--- a/core/copy_headers.mk
+++ b/core/copy_headers.mk
@@ -4,15 +4,13 @@
###########################################################
$(call record-module-type,COPY_HEADERS)
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),)
- $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_COPY_HEADERS may not be used with host modules >&2)
- $(error done)
+ $(call pretty-error,LOCAL_COPY_HEADERS may not be used with host modules)
endif
# Modules linking against the SDK do not have the include path to use
# COPY_HEADERS, so prevent them from exporting any either.
ifdef LOCAL_SDK_VERSION
-$(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Modules using LOCAL_SDK_VERSION may not use LOCAL_COPY_HEADERS >&2)
-$(error done)
+ $(call pretty-error,Modules using LOCAL_SDK_VERSION may not use LOCAL_COPY_HEADERS)
endif
include $(BUILD_SYSTEM)/local_vndk.mk
@@ -22,11 +20,20 @@
# present.
ifdef BOARD_VNDK_VERSION
ifndef LOCAL_USE_VNDK
-$(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Only vendor modules using LOCAL_USE_VNDK may use LOCAL_COPY_HEADERS >&2)
-$(error done)
+ $(call pretty-error,Only vendor modules using LOCAL_USE_VNDK may use LOCAL_COPY_HEADERS)
endif
endif
+# Clean up LOCAL_COPY_HEADERS_TO, since soong_ui will be comparing cleaned
+# paths to figure out which headers are obsolete and should be removed.
+LOCAL_COPY_HEADERS_TO := $(call clean-path,$(LOCAL_COPY_HEADERS_TO))
+ifneq ($(filter /% .. ../%,$(LOCAL_COPY_HEADERS_TO)),)
+ $(call pretty-error,LOCAL_COPY_HEADERS_TO may not start with / or ../ : $(LOCAL_COPY_HEADERS_TO))
+endif
+ifeq ($(LOCAL_COPY_HEADERS_TO),.)
+ LOCAL_COPY_HEADERS_TO :=
+endif
+
# Create a rule to copy each header, and make the
# all_copied_headers phony target depend on each
# destination header. copy-one-header defines the
diff --git a/core/main.mk b/core/main.mk
index e24065c..b51603d 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -232,6 +232,17 @@
# mount system_other partition.
ADDITIONAL_DEFAULT_PROPERTIES += ro.postinstall.fstab.prefix=/system
+# Set ro.product.vndk.version to know the VNDK version required by product
+# modules. It uses the version in PRODUCT_PRODUCT_VNDK_VERSION. If the value
+# is "current", use PLATFORM_VNDK_VERSION.
+ifdef PRODUCT_PRODUCT_VNDK_VERSION
+ifeq ($(PRODUCT_PRODUCT_VNDK_VERSION),current)
+ADDITIONAL_PRODUCT_PROPERTIES += ro.product.vndk.version=$(PLATFORM_VNDK_VERSION)
+else
+ADDITIONAL_PRODUCT_PROPERTIES += ro.product.vndk.version=$(PRODUCT_PRODUCT_VNDK_VERSION)
+endif
+endif
+
# -----------------------------------------------------------------
###
### In this section we set up the things that are different
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 352a0b5..7d182c4 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -111,7 +111,6 @@
ip-up-vpn \
javax.obex \
keystore \
- ld.config.txt \
ld.mc \
libaaudio \
libamidi \
diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk
index 9df26a9..4f7602d 100644
--- a/target/product/sdk_phone_x86.mk
+++ b/target/product/sdk_phone_x86.mk
@@ -15,6 +15,7 @@
#
QEMU_USE_SYSTEM_EXT_PARTITIONS := true
PRODUCT_USE_DYNAMIC_PARTITIONS := true
+BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2
#
# All components inherited here go to system image