Rearrange PWROFF_FLAG flag setting 26/246226/2
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 27 Oct 2020 06:05:03 +0000 (15:05 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 27 Oct 2020 06:27:54 +0000 (06:27 +0000)
Set PWROFF_FLAG when the poweroff enters POWEROFF_TRIGGERED stage.

Change-Id: I4129f654792e6ad090774cbc46e0f5a64692e64a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot/display/key-filter.c
plugins/mobile/display/key-filter.c
plugins/tv/display/key-filter.c
plugins/wearable/display/key-filter.c
src/power/power-handler.c

index 11821a6..bc9d0dd 100644 (file)
@@ -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.");
index 7998b16..7a57a98 100644 (file)
@@ -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)
index b28d7ec..68fcf78 100644 (file)
@@ -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.");
index 32691f8..cdea506 100644 (file)
@@ -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)
index 8b6684f..693c4a4 100644 (file)
@@ -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();