summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 6c769e6..db1637d 100644
--- a/utils.c
+++ b/utils.c
@@ -60,13 +60,22 @@ static struct list_node active_hint_list_head;
const char* pkg = "QTI PowerHAL";
static void* get_qcopt_handle() {
+ char qcopt_lib_path[PATH_MAX] = {0};
void* handle = NULL;
dlerror();
- handle = dlopen(PERF_HAL_PATH, RTLD_NOW);
+ if (property_get("ro.vendor.extension_library", qcopt_lib_path, NULL)) {
+ handle = dlopen(qcopt_lib_path, RTLD_NOW);
+ if (!handle) {
+ ALOGE("Unable to open %s: %s\n", qcopt_lib_path, dlerror());
+ }
+ }
if (!handle) {
- ALOGE("Unable to open %s: %s\n", PERF_HAL_PATH, dlerror());
+ handle = dlopen(PERF_HAL_PATH, RTLD_NOW);
+ if (!handle) {
+ ALOGE("Unable to open %s: %s\n", PERF_HAL_PATH, dlerror());
+ }
}
return handle;