diff options
author | lokilee73 <changjoo.lee@samsung.com> | 2019-04-16 14:18:10 +0900 |
---|---|---|
committer | Hyotaek Shim <hyotaek.shim@samsung.com> | 2019-04-18 01:56:12 +0000 |
commit | 94579a331cb2efe3273c1326a45faee452fa539a (patch) | |
tree | d86da6c738b2cf0b07423cf227a6db8e986cad1e /plugins/wearable | |
parent | 83a6773a170423528fea21e62f0c70798b25e2db (diff) | |
download | deviced-94579a331cb2efe3273c1326a45faee452fa539a.tar.gz deviced-94579a331cb2efe3273c1326a45faee452fa539a.tar.bz2 deviced-94579a331cb2efe3273c1326a45faee452fa539a.zip |
Fix LCDAlwaysOn and powerkey behaviors
Do not affect powerkey behaviors even when LCDAlwaysOn is 'yes' in display.conf.
Mobile
- LCD on/off by short pressed powerkey
- Popup by long pressed powerkey
Wearable
- Menu by short pressed powerkey
- Popup by long pressed powerkey
TV, Iot
- Powering off by short or long pressed powerkey
Change-Id: Ic80a31638a65ed8187d83e2e0e66d7d2f78655bd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Diffstat (limited to 'plugins/wearable')
-rw-r--r-- | plugins/wearable/display/key-filter.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index 051a12d1..a6cb3fc6 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -160,11 +160,7 @@ static void longkey_pressed() return; } - - if (display_conf.lcd_always_on) - opt = POWEROFF_ACT; - else - opt = PWROFF_POPUP_ACT; + opt = PWROFF_POPUP_ACT; power_execute(opt); } @@ -392,27 +388,6 @@ static int lcdoff_powerkey(void) return ignore; } -static bool release_short_powerkey(void) -{ -// 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; - } - - return true; -} - static int process_back_key(struct input_event *pinput) { int ignore = true; @@ -438,7 +413,14 @@ static int process_power_key(struct input_event *pinput) case KEY_RELEASED: check_key_pair(pinput->code, pinput->value, &value); - ignore = release_short_powerkey(); + if (!display_conf.powerkey_doublepress) { + if (display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) + lcdoff_powerkey(); + else + _D("No lcdoff capability!"); + } else if (skip_lcd_off) { + ignore = false; + } if (!display_has_caps(caps, DISPLAY_CAPA_LCDON)) ignore = true; |