Define __ANDROID_VENDOR_API__ for product variants
As the product variants are also able to use LLNDK libraries, they
must know the version of the LLNDK libraries that the system is
building.
Provide the __ANDROID_VENDOR_API__ for both product and vendor
variants for this purpose.
Bug: 368559337
Test: TH
Change-Id: If4e80006641b42b3b08e0b48a49d319ae05e567e
diff --git a/core/binary.mk b/core/binary.mk
index 1e98bc0..3481144 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -330,18 +330,20 @@
ifneq ($(LOCAL_IN_VENDOR),)
# Vendor modules have LOCAL_IN_VENDOR
my_cflags += -D__ANDROID_VENDOR__
-
- ifeq ($(BOARD_API_LEVEL),)
- # TODO(b/314036847): This is a fallback for UDC targets.
- # This must be a build failure when UDC is no longer built from this source tree.
- my_cflags += -D__ANDROID_VENDOR_API__=$(PLATFORM_SDK_VERSION)
- else
- my_cflags += -D__ANDROID_VENDOR_API__=$(BOARD_API_LEVEL)
- endif
else ifneq ($(LOCAL_IN_PRODUCT),)
# Product modules have LOCAL_IN_PRODUCT
my_cflags += -D__ANDROID_PRODUCT__
endif
+
+ # Define __ANDROID_VENDOR_API__ for both product and vendor variants because
+ # they both use the same LLNDK libraries.
+ ifeq ($(BOARD_API_LEVEL),)
+ # TODO(b/314036847): This is a fallback for UDC targets.
+ # This must be a build failure when UDC is no longer built from this source tree.
+ my_cflags += -D__ANDROID_VENDOR_API__=$(PLATFORM_SDK_VERSION)
+ else
+ my_cflags += -D__ANDROID_VENDOR_API__=$(BOARD_API_LEVEL)
+ endif
endif
ifndef LOCAL_IS_HOST_MODULE