Stops including extra VNDK apexes if the VNDK current apex is on vendor.
This is needed for merged mixed-release builds where the vendor half on
release N contains VNDK current (vN) on /vendor. This change prevents
the system half on release N+k from placing another copy of VNDK vN
on /system_ext.
Test: Build and merge crosshatch with S system and R vendor, boot
Bug: 176993126
Change-Id: I5322931244e060b2e7c92d9578e5eb64b098d1d6
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index b4df5fe..f21fe16 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -161,7 +161,10 @@
include $(BUILD_PHONY_PACKAGE)
include $(CLEAR_VARS)
-_vndk_versions := $(PRODUCT_EXTRA_VNDK_VERSIONS)
+_vndk_versions :=
+ifeq ($(filter com.android.vndk.current.on_vendor, $(PRODUCT_PACKAGES)),)
+ _vndk_versions += $(PRODUCT_EXTRA_VNDK_VERSIONS)
+endif
ifneq ($(BOARD_VNDK_VERSION),current)
_vndk_versions += $(BOARD_VNDK_VERSION)
endif