diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-11-22 18:12:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-11-22 18:12:09 +0000 |
commit | 5554ff0e0cf148ac31d49b37ae06babe2ffc4006 (patch) | |
tree | bea931a7fb94a75fde75530049b77ab873c0e2a2 | |
parent | 9cada866d6c97170844805dbc9b37a974b2890dd (diff) | |
parent | b0b43f3b3336388db3b23f12ccf950f6e328f9c8 (diff) | |
download | libhardware-main-16k.tar.gz |
Merge "Merge "Make libhardware host_supported" am: 65d6174bbc" into main-16kmain-16k
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | hardware.c | 9 |
2 files changed, 11 insertions, 2 deletions
@@ -86,6 +86,7 @@ cc_library_shared { header_libs: ["libhardware_headers"], export_header_lib_headers: ["libhardware_headers"], + host_supported: true, recovery_available: true, vendor_available: true, vndk: { @@ -93,6 +94,9 @@ cc_library_shared { support_system_process: true, }, target: { + host: { + exclude_shared_libs: ["libvndksupport"], + }, recovery: { exclude_shared_libs: ["libvndksupport"], }, @@ -30,7 +30,7 @@ #define LOG_TAG "HAL" #include <log/log.h> -#if !defined(__ANDROID_RECOVERY__) +#if !defined(__ANDROID_RECOVERY__) && defined(__ANDROID__) #include <vndksupport/linker.h> #endif @@ -97,7 +97,7 @@ static int load(const char *id, */ handle = dlopen(path, RTLD_NOW); } else { -#if defined(__ANDROID_RECOVERY__) +#if defined(__ANDROID_RECOVERY__) || !defined(__ANDROID__) handle = dlopen(path, RTLD_NOW); #else handle = android_load_sphal_library(path, RTLD_NOW); @@ -206,8 +206,13 @@ int hw_get_module_by_class(const char *class_id, const char *inst, if (inst) snprintf(name, PATH_MAX, "%s.%s", class_id, inst); +#if defined(__ANDROID__) else strlcpy(name, class_id, PATH_MAX); +#else + else + snprintf(name, PATH_MAX, "%s", class_id); +#endif /* * Here we rely on the fact that calling dlopen multiple times on |