summaryrefslogtreecommitdiff
path: root/hardware.c
diff options
context:
space:
mode:
authorJerry Zhang <zhangjerry@google.com>2018-06-20 17:04:52 -0700
committerHridya Valsaraju <hridya@google.com>2018-08-10 11:42:44 -0700
commit551e1f7bd9fbf99d45be20b7c01b5ff995bbd3b7 (patch)
tree767a6913164792f2fe654eaf5ae9e8d7a7dfe447 /hardware.c
parent65d52dd3c9982abd7f383f0efddf04e1e0034681 (diff)
downloadlibhardware-551e1f7bd9fbf99d45be20b7c01b5ff995bbd3b7.tar.gz
Allow libhardware to be used in recovery
The default boot ctrl implementation depends on libhardware. Bug: 78793464 Test: Compiles, can load bootctrl in recovery Change-Id: I9c8aa8b00b9b81f11736de13c85973e113056e69
Diffstat (limited to 'hardware.c')
-rw-r--r--hardware.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hardware.c b/hardware.c
index bd55087b..40ae1d13 100644
--- a/hardware.c
+++ b/hardware.c
@@ -29,7 +29,9 @@
#define LOG_TAG "HAL"
#include <log/log.h>
+#if !defined(__ANDROID_RECOVERY__)
#include <vndksupport/linker.h>
+#endif
/** Base path of the hal modules */
#if defined(__LP64__)
@@ -94,7 +96,11 @@ static int load(const char *id,
*/
handle = dlopen(path, RTLD_NOW);
} else {
+#if defined(__ANDROID_RECOVERY__)
+ handle = dlopen(path, RTLD_NOW);
+#else
handle = android_load_sphal_library(path, RTLD_NOW);
+#endif
}
if (handle == NULL) {
char const *err_str = dlerror();