Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a2f7145 authored by Jooyung Han's avatar Jooyung Han
Browse files

libbinder_ndk: V APIs are guarded with V

Using __ANDROID_API_FUTURE__ for V symbols was a workaround because
__builtin_available(android __ANDROID_API_V__,*) didn't work when V is
still a preview. It's fixed now in clang and we can use
__ANDROID_API_V__ when gaurding V symbols. The guard evaluates to true
if the platform SDK version is V or higher or it's a preview.

Bug: 322384429
Test: presubmit
Change-Id: If35077330d0b002091cf191c2de31dc93e09178d
parent 5b7e5350
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -26,13 +26,10 @@
#if defined(__ANDROID_VENDOR__)
#include <android/llndk-versioning.h>
#else  // __ANDROID_VENDOR__
#if defined(API_LEVEL_AT_LEAST)
// Redefine API_LEVEL_AT_LEAST here to replace the version to __ANDROID_API_FUTURE__ as a workaround
#undef API_LEVEL_AT_LEAST
#endif
// TODO(b/322384429) switch this __ANDROID_API_FUTURE__ to sdk_api_level when V is finalized
#if !defined(API_LEVEL_AT_LEAST)
#define API_LEVEL_AT_LEAST(sdk_api_level, vendor_api_level) \
    (__builtin_available(android __ANDROID_API_FUTURE__, *))
    (__builtin_available(android sdk_api_level, *))
#endif
#endif  // __ANDROID_VENDOR__

namespace aidl::android::os {