From 85e00bf2ce6aa080a42ad6f8dd47733b514cceac Mon Sep 17 00:00:00 2001 From: Zhao Wei Liew Date: Sun, 26 Jun 2016 21:29:34 +0800 Subject: power: Simplify display_hint_sent Check for whether the display hint has been sent at the start of the set_interactive() function in the common powerHAL. This gets rid of the need to replicate the same variable in every target-specific powerHAL that implements the set_interactive_override() function. Change-Id: If7dd11fcb578211f4f83847f9257232c4138ce53 --- power-660.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'power-660.c') diff --git a/power-660.c b/power-660.c index 56c5d7c..b2870bd 100644 --- a/power-660.c +++ b/power-660.c @@ -51,7 +51,6 @@ #define MIN_VAL(X, Y) ((X > Y) ? (Y) : (X)) -static int display_hint_sent; static int video_encode_hint_sent; static int cam_preview_hint_sent; @@ -139,17 +138,13 @@ int set_interactive_override(int on) { memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); num_resources = sizeof(res) / sizeof(res[0]); } - if (!display_hint_sent) { - perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, num_resources); - display_hint_sent = 1; - } + perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, num_resources); } } else { /* Display on. */ if (is_interactive_governor(governor)) { undo_hint_action(DISPLAY_STATE_HINT_ID); - display_hint_sent = 0; } } return HINT_HANDLED; -- cgit v1.2.3