From 8768b01a896da204957a86071cc07b3494476297 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Tue, 27 Oct 2020 15:05:03 +0900 Subject: [PATCH] Rearrange PWROFF_FLAG flag setting Set PWROFF_FLAG when the poweroff enters POWEROFF_TRIGGERED stage. Change-Id: I4129f654792e6ad090774cbc46e0f5a64692e64a Signed-off-by: Youngjae Cho --- plugins/iot/display/key-filter.c | 1 - plugins/mobile/display/key-filter.c | 1 - plugins/tv/display/key-filter.c | 1 - plugins/wearable/display/key-filter.c | 1 - src/power/power-handler.c | 5 ++--- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/iot/display/key-filter.c b/plugins/iot/display/key-filter.c index 11821a6..bc9d0dd 100644 --- a/plugins/iot/display/key-filter.c +++ b/plugins/iot/display/key-filter.c @@ -122,7 +122,6 @@ static void pwroff_popup(void) { int ret; - clear_pm_status_flag(PWROFF_FLAG); ret = launch_system_app(APP_POWERKEY, 2, APP_KEY_TYPE, APP_POWERKEY); if (ret < 0) _E("Failed to launch power off popup."); diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c index 7998b16..7a57a98 100644 --- a/plugins/mobile/display/key-filter.c +++ b/plugins/mobile/display/key-filter.c @@ -138,7 +138,6 @@ static void longkey_pressed(void) _D("No poweroff capability!"); return; } - clear_pm_status_flag(PWROFF_FLAG); } static gboolean longkey_restore_cb(void *data) diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index b28d7ec..68fcf78 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -122,7 +122,6 @@ static void pwroff_popup(void) { int ret; - clear_pm_status_flag(PWROFF_FLAG); ret = launch_system_app(APP_POWERKEY, 2, APP_KEY_TYPE, APP_POWERKEY); if (ret < 0) _E("Failed to launch power off popup."); diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index 32691f8..cdea506 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -138,7 +138,6 @@ static void longkey_pressed(void) _D("No poweroff capability!"); return; } - clear_pm_status_flag(PWROFF_FLAG); } static gboolean longkey_restore_cb(void *data) diff --git a/src/power/power-handler.c b/src/power/power-handler.c index 8b6684f..693c4a4 100644 --- a/src/power/power-handler.c +++ b/src/power/power-handler.c @@ -356,9 +356,6 @@ static gboolean poweroff_wait_timeout_cb(void *data) poweroff_prepare(); poweroff_request_shutdown(); - - if (disp_plgn->update_pm_setting) - disp_plgn->update_pm_setting(SETTING_POWEROFF, poweroff_opt.type); } else { _D("Poweroff wait timer for pid %d is expired, but keep waiting for others...", pid); } @@ -510,6 +507,8 @@ static int power_execute_pid(const char *typename, const char *option) _E("Failed to set vconf value for power off status: %d", vconf_get_ext_errno()); poweroff_stage = POWEROFF_TRIGGERED; + if (disp_plgn->update_pm_setting) + disp_plgn->update_pm_setting(SETTING_POWEROFF, poweroff_opt.type); /* Poweroff event broadcasting */ system_shutdown_send_system_event(); -- 2.7.4