From c581c222e6e3d19a148385d485885253f01f1e66 Mon Sep 17 00:00:00 2001 From: wchang kim Date: Tue, 21 Mar 2017 10:52:42 +0900 Subject: [PATCH] dislay: Fixed side-effect of processing powerkey. - When powerkey is pressed, key-filter should check the configuration of doublekey and lcdalwayson. - TV : doublekey is no, lcdalwayson is yes -> longkey_pressed - Mobile : doublekey is no, lcdalwayson is no -> lcdoff_powerkey() - Wearable : doublekey is yes, lcdalwayson is no -> ignore Change-Id: I95b02a46aca84632c4dda451b1f847596429e32d --- src/display/key-filter.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/display/key-filter.c b/src/display/key-filter.c index 407ba3e..ede465f 100644 --- a/src/display/key-filter.c +++ b/src/display/key-filter.c @@ -364,13 +364,24 @@ static int lcdoff_powerkey(void) static bool release_short_powerkey(void) { - if (!display_conf.lcd_always_on) { + // mobile d - no, a - no + // wearable d - yes, a - no + // tv d - no, a - yes + if (!display_conf.powerkey_doublepress && !display_conf.lcd_always_on) { lcdoff_powerkey(); return true; + } else if (display_conf.powerkey_doublepress && !display_conf.lcd_always_on) { + if (skip_lcd_off) { + return false; + } else { + return true; + } + } else if (!display_conf.powerkey_doublepress && display_conf.lcd_always_on) { + longkey_pressed(); + return false; } - longkey_pressed(); - return false; + return true; } static int process_power_key(struct input_event *pinput) -- 2.7.4