summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2019-02-19 18:06:41 +0800
committerElektroschmock <elektroschmock78@googlemail.com>2019-03-14 17:54:49 +0100
commit6ce3355bb7f3c7cabf6667b4c535f11d978145b0 (patch)
treecf0a8bcd6ff6c6f803493e8a608fd243adef2662
parent412fbab4851478670ff6341a368b2105f9eb14cc (diff)
Revert "power: Remove interaction_with_handle"
* Fix compiler warnings by the way This reverts commit 0a53ddc7f2683b2e2c7725f8d459814b3a01613b. Change-Id: I21b39bfee79e347aa9375f7120b5a3027b8f4468
-rw-r--r--hidl/power/utils.c23
-rw-r--r--hidl/power/utils.h1
2 files changed, 23 insertions, 1 deletions
diff --git a/hidl/power/utils.c b/hidl/power/utils.c
index ffa3e34c..acf5f58d 100644
--- a/hidl/power/utils.c
+++ b/hidl/power/utils.c
@@ -254,7 +254,28 @@ void interaction(int duration, int num_args, int opt_list[])
#endif
}
-//this is interaction using perf_hint instead of
+#ifndef INTERACTION_BOOST
+int interaction_with_handle(int UNUSED(lock_handle), int UNUSED(duration), int UNUSED(num_args), int UNUSED(opt_list[]))
+{
+ return 0;
+#else
+int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[])
+{
+ if (duration < 0 || num_args < 1 || opt_list[0] == 0)
+ return 0;
+
+ if (qcopt_handle) {
+ if (perf_lock_acq) {
+ lock_handle = perf_lock_acq(lock_handle, duration, opt_list, num_args);
+ if (lock_handle == -1)
+ ALOGE("Failed to acquire lock.");
+ }
+ }
+ return lock_handle;
+#endif
+}
+
+//this is interaction_with_handle using perf_hint instead of
//perf_lock_acq
int perf_hint_enable(int hint_id , int duration)
{
diff --git a/hidl/power/utils.h b/hidl/power/utils.h
index 79ebd333..6592b79a 100644
--- a/hidl/power/utils.h
+++ b/hidl/power/utils.h
@@ -41,6 +41,7 @@ void undo_hint_action(int hint_id);
void undo_initial_hint_action();
void release_request(int lock_handle);
void interaction(int duration, int num_args, int opt_list[]);
+int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[]);
int perf_hint_enable(int hint_id, int duration);
long long calc_timespan_us(struct timespec start, struct timespec end);