Snap for 11399958 from b58d46a3a7e657f5d54893ac3234007c9f0394c6 to 24Q2-release
Change-Id: Ic07364022e015563187721bbccdc60971c9fc198
diff --git a/hardware.c b/hardware.c
index 7907331..94b5d5d 100644
--- a/hardware.c
+++ b/hardware.c
@@ -179,20 +179,20 @@
const char *subname)
{
#ifdef __ANDROID_APEX__
- // When used in APEX, it should look only into the same APEX because
+ // When used in VAPEX, it should look only into the same APEX because
// libhardware modules don't provide ABI stability.
- if (__builtin_available(android AAPEXSUPPORT_API, *)) {
- AApexInfo *apex_info;
- if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
- snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
- AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
- AApexInfo_destroy(apex_info);
- if (access(path, R_OK) == 0)
- return 0;
- }
- } else {
- ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_API__);
+#if __ANDROID_VENDOR_API__ >= 202404
+ AApexInfo *apex_info;
+ if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
+ snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
+ AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
+ AApexInfo_destroy(apex_info);
+ if (access(path, R_OK) == 0)
+ return 0;
}
+#else // __ANDROID_VENDOR_API__
+ ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_VENDOR_API__);
+#endif // __ANDROID_VENDOR_API__
#else // __ANDROID_APEX__
snprintf(path, path_len, "%s/%s.%s.so",
HAL_LIBRARY_PATH3, name, subname);