diff options
author | Jooyung Han <jooyung@google.com> | 2024-02-02 01:58:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-02 01:58:22 +0000 |
commit | bce3918b3dfb67f25f927ff35d36c4d37f2d31ca (patch) | |
tree | 83951ad01a20bcbef7ce5da82dcdc7e06f353ceb | |
parent | 16e1d034000cba2d993de762ff9fb0c00fcab375 (diff) | |
parent | 4695d8a846325ca0e6910c8beb2fc172f35779d3 (diff) | |
download | libhardware-bce3918b3dfb67f25f927ff35d36c4d37f2d31ca.tar.gz |
Merge "Use LLNDK guard instead of builtin_available" into main
-rw-r--r-- | hardware.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -179,20 +179,20 @@ static int hw_module_exists(char *path, size_t path_len, const char *name, 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); |