summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-05-17 01:53:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-05-17 01:53:56 +0000
commitcb7791b44231be633e38ce860b1a56de9cd704a5 (patch)
tree399beec8bc07e5c7bb82c42b52a6a943fdf227dc
parenta7c9c69ad43484ae5a29268c583ce9799819002d (diff)
parent375f1a4d3288a43cb0b6441906c693301b21e78d (diff)
downloadlibhardware-cb7791b44231be633e38ce860b1a56de9cd704a5.tar.gz
Merge "Load legacy HAL modules from the sphal namespace" into oc-dev
-rw-r--r--Android.bp1
-rw-r--r--hardware.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index f6aacd20..9c5a9cce 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,6 +23,7 @@ cc_library_shared {
"libcutils",
"liblog",
"libdl",
+ "libvndksupport",
],
cflags: ["-DQEMU_HARDWARE"],
diff --git a/hardware.c b/hardware.c
index 7e4debec..37b61c44 100644
--- a/hardware.c
+++ b/hardware.c
@@ -29,6 +29,8 @@
#define LOG_TAG "HAL"
#include <log/log.h>
+#include <vndksupport/linker.h>
+
/** Base path of the hal modules */
#if defined(__LP64__)
#define HAL_LIBRARY_PATH1 "/system/lib64/hw"
@@ -80,7 +82,7 @@ static int load(const char *id,
* dlopen returns. Since RTLD_GLOBAL is not or'd in with
* RTLD_NOW the external symbols will not be global
*/
- handle = dlopen(path, RTLD_NOW);
+ handle = android_load_sphal_library(path, RTLD_NOW);
if (handle == NULL) {
char const *err_str = dlerror();
ALOGE("load: module=%s\n%s", path, err_str?err_str:"unknown");