static struct timeval tv_start_poweroff;
static int poweroff_delay_second = 0;
+static int silent_reboot = 0;
static void poweroff_start_animation(void)
{
else
return;
+ if (option && strncmp(option, "silent", sizeof("silent")) == 0)
+ silent_reboot = 1;
+
fd = open(optpath, O_RDWR|O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0) {
_E("Failed to create '%s'.", optpath);
bundle_free(b);
}
-void poweroff_prepare(uint64_t state, void *option)
+void poweroff_prepare(uint64_t state)
{
int vconf = VCONFKEY_SYSMAN_POWER_OFF_NONE;
if (!is_poweroff_state(state))
return;
- mark_poweroff_option(state, option);
-
if (state == DEVICED_POWER_STATE_POWEROFF)
vconf = VCONFKEY_SYSMAN_POWER_OFF_DIRECT;
else if (state == DEVICED_POWER_STATE_REBOOT)
system_shutdown_send_system_event();
/* Skip running animation if it is silent reboot */
- if (option && strncmp(option, "silent", sizeof("silent")) == 0)
+ if (silent_reboot)
return;
poweroff_start_animation();
goto out;
}
+ mark_poweroff_option(next, option);
+
CRITICAL_LOG("Poweroff pid=%d(%s) requests type=%s option=%s.", ret, comm, type, option);
- power_request_change_state_strict(DEVICED_POWER_STATE_ALL, next, 9000, option);
+ power_request_change_state_strict(DEVICED_POWER_STATE_ALL, next, 9000, NULL);
out:
g_free(type);
void power_off_init(void);
int poweroff_check_revived(void);
void poweroff_request_shutdown(int state);
-void poweroff_prepare(uint64_t state, void *option);
+void poweroff_prepare(uint64_t state);
void poweroff_main(void *udata);
#endif /* __DEVICED_POWER_OFF_H__ */
// do not transition anymore after poweroff
unregister_notifier(DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE, transition_request_callback);
- poweroff_prepare(current, data);
+ poweroff_prepare(current);
poweroff_main((void *)(intptr_t) current);
}