Use LLNDK guard instead of builtin_available
APEXSUPPORT_API was a workaround when we had no support for __ANDROID_VENDOR_API__. Since we have it now, use it instead of builtin_available(android APEXSUPPORT_API). Bug: 302088370 Test: consumerir HAL APEX loading consumerir.default from the same APEX Test: ConsumerIrTest VtsHalIrTargetTest Change-Id: I6c9cf7e4555f7f242cc61defe7a67e3d11d79f6e
This commit is contained in:
parent
16e1d03400
commit
4695d8a846
1 changed files with 12 additions and 12 deletions
24
hardware.c
24
hardware.c
|
@ -179,20 +179,20 @@ static int hw_module_exists(char *path, size_t path_len, const char *name,
|
||||||
const char *subname)
|
const char *subname)
|
||||||
{
|
{
|
||||||
#ifdef __ANDROID_APEX__
|
#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.
|
// libhardware modules don't provide ABI stability.
|
||||||
if (__builtin_available(android AAPEXSUPPORT_API, *)) {
|
#if __ANDROID_VENDOR_API__ >= 202404
|
||||||
AApexInfo *apex_info;
|
AApexInfo *apex_info;
|
||||||
if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
|
if (AApexInfo_create(&apex_info) == AAPEXINFO_OK) {
|
||||||
snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
|
snprintf(path, path_len, "/apex/%s/%s/%s.%s.so",
|
||||||
AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
|
AApexInfo_getName(apex_info), HAL_LIBRARY_SUBDIR, name, subname);
|
||||||
AApexInfo_destroy(apex_info);
|
AApexInfo_destroy(apex_info);
|
||||||
if (access(path, R_OK) == 0)
|
if (access(path, R_OK) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_API__);
|
|
||||||
}
|
}
|
||||||
|
#else // __ANDROID_VENDOR_API__
|
||||||
|
ALOGE("hw_module_exists: libapexsupport is not supported in %d.", __ANDROID_VENDOR_API__);
|
||||||
|
#endif // __ANDROID_VENDOR_API__
|
||||||
#else // __ANDROID_APEX__
|
#else // __ANDROID_APEX__
|
||||||
snprintf(path, path_len, "%s/%s.%s.so",
|
snprintf(path, path_len, "%s/%s.%s.so",
|
||||||
HAL_LIBRARY_PATH3, name, subname);
|
HAL_LIBRARY_PATH3, name, subname);
|
||||||
|
|
Loading…
Reference in a new issue