power: send poweroff notifications before the poweroff operations 33/80733/1
authortaeyoung <ty317.kim@samsung.com>
Wed, 20 Jul 2016 02:27:08 +0000 (11:27 +0900)
committertaeyoung <ty317.kim@samsung.com>
Wed, 20 Jul 2016 02:27:08 +0000 (11:27 +0900)
- Power off operations contain unloading devices and
  disabling journald and cgroup. Thus poweroff notifications
  need to be delivered to the user space before the poweroff
  operations.

Change-Id: I7b4ed05c571fc6bfe2110527a3281ce5f3910a2c
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/power/power-handler.c

index ed421b8..79f2761 100644 (file)
@@ -262,14 +262,15 @@ static void poweroff_idler_cb(void *data)
        telephony_start();
 
        pm_lock_internal(INTERNAL_LOCK_POWEROFF, LCD_OFF, STAY_CUR_STATE, 0);
-       poweroff_stop_systemd_service();
 
        if (val == POWER_OFF_DIRECT || val == POWER_OFF_RESTART) {
                poweroff_send_broadcast(val);
-               device_notify(DEVICE_NOTIFIER_POWEROFF, &val);
                system_shutdown_send_system_event();
+               device_notify(DEVICE_NOTIFIER_POWEROFF, &val);
        }
 
+       poweroff_stop_systemd_service();
+
        /* TODO for notify. will be removed asap. */
        vconf_set_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, val);