Set __ANDROID_API__ for vendor binaries to vndk version.

When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.

If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.

Bug: 74833244
Test: Build and check boot.
Change-Id: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
Merged-In: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
(cherry picked from commit 65c680e285)
This commit is contained in:
Justin Yun
2018-03-20 07:16:14 +09:00
parent ac1109733d
commit 05c62fc0f4

View File

@@ -225,7 +225,15 @@ ifneq ($(LOCAL_SDK_VERSION),)
endif
ifneq ($(LOCAL_USE_VNDK),)
my_cflags += -D__ANDROID_API__=__ANDROID_API_FUTURE__ -D__ANDROID_VNDK__
# Required VNDK version for vendor modules is BOARD_VNDK_VERSION.
my_vndk_version := $(BOARD_VNDK_VERSION)
ifeq ($(my_vndk_version),current)
# Build with current PLATFORM_VNDK_VERSION.
# If PLATFORM_VNDK_VERSION has a CODENAME, it will return
# __ANDROID_API_FUTURE__.
my_vndk_version := $(call codename-or-sdk-to-sdk,$(PLATFORM_VNDK_VERSION))
endif
my_cflags += -D__ANDROID_API__=$(my_vndk_version) -D__ANDROID_VNDK__
endif
ifndef LOCAL_IS_HOST_MODULE