summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2019-04-16 14:18:10 +0900
committerHyotaek Shim <hyotaek.shim@samsung.com>2019-04-18 01:56:12 +0000
commit94579a331cb2efe3273c1326a45faee452fa539a (patch)
treed86da6c738b2cf0b07423cf227a6db8e986cad1e /plugins
parent83a6773a170423528fea21e62f0c70798b25e2db (diff)
downloaddeviced-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')
-rw-r--r--plugins/iot/display/key-filter.c80
-rw-r--r--plugins/mobile/display/key-filter.c36
-rw-r--r--plugins/tv/display/key-filter.c80
-rw-r--r--plugins/wearable/display/key-filter.c36
4 files changed, 22 insertions, 210 deletions
diff --git a/plugins/iot/display/key-filter.c b/plugins/iot/display/key-filter.c
index cf6cfa76..6ef373c5 100644
--- a/plugins/iot/display/key-filter.c
+++ b/plugins/iot/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;
}
diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c
index cf6cfa76..6789e715 100644
--- a/plugins/mobile/display/key-filter.c
+++ b/plugins/mobile/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 = PWROFF_POPUP_ACT;
power_execute(opt);
}
@@ -373,27 +369,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_power_key(struct input_event *pinput)
{
int ignore = true;
@@ -406,7 +381,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;
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;
}
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;