summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--power-common.c15
-rw-r--r--utils.c9
-rw-r--r--utils.h1
3 files changed, 15 insertions, 10 deletions
diff --git a/power-common.c b/power-common.c
index 1dc9334..6c1e40f 100644
--- a/power-common.c
+++ b/power-common.c
@@ -77,11 +77,9 @@ void power_hint(power_hint_t hint, void *data)
return;
}
switch(hint) {
- case POWER_HINT_VSYNC:
- break;
case POWER_HINT_VR_MODE:
ALOGI("VR mode power hint not handled in power_hint_override");
- break;
+ break;
case POWER_HINT_INTERACTION:
{
int resources[] = {0x702, 0x20F, 0x30F};
@@ -99,15 +97,18 @@ void power_hint(power_hint_t hint, void *data)
if (handles[hint].handle > 0)
handles[hint].ref_count++;
- }
- else
- if (handles[hint].handle > 0)
+ } else {
+ if (handles[hint].handle > 0) {
if (--handles[hint].ref_count == 0) {
release_request(handles[hint].handle);
handles[hint].handle = 0;
}
- else
+ } else {
ALOGE("Lock for hint: %X was not acquired, cannot be released", hint);
+ }
+ }
+ break;
+ default:
break;
}
}
diff --git a/utils.c b/utils.c
index f7f2251..97c3c55 100644
--- a/utils.c
+++ b/utils.c
@@ -210,12 +210,15 @@ int is_interactive_governor(char* governor) {
return 0;
}
+#ifndef INTERACTION_BOOST
+void interaction(int UNUSED(duration), int UNUSED(num_args), int UNUSED(opt_list[]))
+{
+#else
void interaction(int duration, int num_args, int opt_list[])
{
-#ifdef INTERACTION_BOOST
static int lock_handle = 0;
- if (duration < 0 || num_args < 1 || opt_list[0] == NULL)
+ if (duration < 0 || num_args < 1 || opt_list[0] == 0)
return;
if (qcopt_handle) {
@@ -230,7 +233,7 @@ 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[])
{
- if (duration < 0 || num_args < 1 || opt_list[0] == NULL)
+ if (duration < 0 || num_args < 1 || opt_list[0] == 0)
return 0;
if (qcopt_handle) {
diff --git a/utils.h b/utils.h
index 4c3dc7f..7f8b3dd 100644
--- a/utils.h
+++ b/utils.h
@@ -42,6 +42,7 @@ void unvote_ondemand_sdf_low();
void perform_hint_action(int hint_id, int resource_values[],
int num_resources);
void undo_hint_action(int hint_id);
+void undo_initial_hint_action();
void release_request(int lock_handle);
int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[]);
int perf_hint_enable(int hint_id, int duration);