summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <xda@vinschen.de>2018-04-09 22:55:59 +0200
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:56 +0300
commita250b9063caba339668dda3d3307f2245ad779dc (patch)
tree9a392f966e2e03e94c315355d792e0cd978cefa6
parentee9bd619746cb0425905baf354e7f52130bb2ef8 (diff)
downloadvendor_qcom_opensource_power-a250b9063caba339668dda3d3307f2245ad779dc.zip
vendor_qcom_opensource_power-a250b9063caba339668dda3d3307f2245ad779dc.tar.gz
vendor_qcom_opensource_power-a250b9063caba339668dda3d3307f2245ad779dc.tar.bz2
power: add back check for ro.vendor.extension_library
This partially reverts I0ce40bbefb8c867dda8ee5eb1f948af2106e692d, "power: Using PerfHAL API". Especially older systems don't provide libqti-perfd-client.so but this is hardcoded since the aforementioned change. Use the former code checking for ro.vendor.extension_library and try to load that library if the property exists before falling back to loading libqti-perfd-client.so. Change-Id: If89e3b88062be10af7cfd43b6ba92a22fda32754 Signed-off-by: Corinna Vinschen <xda@vinschen.de>
-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;