Revert "Use __builtin_available guard"
Revert submission 3334193-no-llndk-versioning
Reason for revert: Droidmonitor created revert due to b/378038995. Will be verifying through ABTD before submission.
Reverted changes: /q/submissionid:3334193-no-llndk-versioning
Change-Id: I7c8262a79fe1f85f1f225a5421aab6126dc76175
diff --git a/libs/ui/Gralloc5.cpp b/libs/ui/Gralloc5.cpp
index 2143f79..c9ec036 100644
--- a/libs/ui/Gralloc5.cpp
+++ b/libs/ui/Gralloc5.cpp
@@ -23,6 +23,7 @@
#include <aidlcommonsupport/NativeHandle.h>
#include <android/binder_manager.h>
#include <android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h>
+#include <android/llndk-versioning.h>
#include <binder/IPCThreadState.h>
#include <dlfcn.h>
#include <ui/FatVector.h>
@@ -90,7 +91,7 @@
}
void* so = nullptr;
- if (__builtin_available(android __ANDROID_API_V__, *)) {
+ if API_LEVEL_AT_LEAST (__ANDROID_API_V__, 202404) {
so = AServiceManager_openDeclaredPassthroughHal("mapper", mapperSuffix.c_str(),
RTLD_LOCAL | RTLD_NOW);
} else {