diff options
Diffstat (limited to 'power-common.c')
-rw-r--r-- | power-common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/power-common.c b/power-common.c index 2e5b8c8..c820972 100644 --- a/power-common.c +++ b/power-common.c @@ -113,6 +113,8 @@ extern void power_set_interactive_ext(int on); #endif void set_interactive(int on) { + static int display_hint_sent; + if (!on) { /* Send Display OFF hint to perf HAL */ perf_hint_enable(VENDOR_HINT_DISPLAY_OFF, 0); @@ -121,6 +123,14 @@ void set_interactive(int on) { perf_hint_enable(VENDOR_HINT_DISPLAY_ON, 0); } + /** + * Ignore consecutive display-off hints + * Consecutive display-on hints are already handled + */ + if (display_hint_sent && !on) return; + + display_hint_sent = !on; + #ifdef SET_INTERACTIVE_EXT power_set_interactive_ext(on); #endif |