diff options
Diffstat (limited to 'plugins/tv/display/key-filter.c')
-rw-r--r-- | plugins/tv/display/key-filter.c | 80 |
1 files changed, 2 insertions, 78 deletions
diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index cf6cfa76..6ef373c5 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -149,11 +149,7 @@ static void longkey_pressed() return; } - - if (display_conf.lcd_always_on) - opt = POWEROFF_ACT; - else - opt = PWROFF_POPUP_ACT; + opt = POWEROFF_ACT; power_execute(opt); } @@ -311,82 +307,10 @@ static int process_menu_key(struct input_event *pinput) return false; } -static int decide_lcdoff(void) -{ - /* It's not needed if it's already LCD off state */ - if (!current_state_in_on() && - backlight_ops.get_lcd_power() != DPMS_ON) - return false; - - /* - * This flag is set at the moment - * that LCD is turned on by power key - * LCD has not to turned off in the situation. - */ - if (skip_lcd_off) - return false; - - /* LCD is not turned off when powerkey is pressed,not released */ - if (key_combination == KEY_COMBINATION_POWERKEY) - return false; - - /* LCD-off is blocked at the moment poweroff popup shows */ - if (cancel_lcdoff) - return false; - - /* LCD-off is blocked when powerkey and volmedown key are pressed */ - if (skip_combination) - return false; - - /* At booting time, display must do not turn off */ - if (!booting_done(NULL)) - return false; - - return true; -} - -static int lcdoff_powerkey(void) -{ - int ignore = true; - - if (decide_lcdoff() == true) { - check_processes(S_NORMAL); - check_processes(S_LCDDIM); - - if (!check_holdkey_block(S_NORMAL) && - !check_holdkey_block(S_LCDDIM)) { - if (display_info.update_auto_brightness) - display_info.update_auto_brightness(false); - switch_off_lcd(); - delete_condition(S_NORMAL); - delete_condition(S_LCDDIM); - update_lcdoff_source(VCONFKEY_PM_LCDOFF_BY_POWERKEY); - if (disp_plgn.pm_change_internal) - disp_plgn.pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_OFF); - } - } else { - ignore = false; - skip_combination = false; - } - cancel_lcdoff = 0; - - 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) { + if (!display_conf.powerkey_doublepress && display_conf.lcd_always_on) { longkey_pressed(); return false; } |