static struct timeval tv_start_poweroff;
static void powerdown_ap(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+static void poweroff_control_cb(keynode_t *in_key, struct ss_main_data *ad);
static int ss_flags = 0;
static Ecore_Timer *poweroff_timer_id = NULL;
static TapiHandle *tapi_handle = NULL;
+static int power_off = 0;
static void make_memps_log(char *file, pid_t pid, char *victim_name)
{
}
PRT_TRACE("Power off by force\n");
- kill(-1, SIGTERM);
/* give a chance to be terminated for each process */
+ power_off = 1;
sleep(1);
sync();
reboot(RB_POWER_OFF);
gettimeofday(&now, NULL);
}
- kill(-1, SIGTERM);
/* give a chance to be terminated for each process */
+ power_off = 1;
sleep(1);
sync();
reboot(RB_POWER_OFF);
int ret;
heynoti_publish(POWEROFF_NOTI_NAME);
+ vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (void*)poweroff_control_cb);
pm_change_state(LCD_NORMAL);
system("/etc/rc.d/rc.shutdown &");
PRT_TRACE_ERR("tapi is not ready yet");
}
}
+static void poweroff_control_cb(keynode_t *in_key, struct ss_main_data *ad)
+{
+ int val;
+ if (vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val) != 0)
+ return;
+ switch (val) {
+ case VCONFKEY_SYSMAN_POWER_OFF_DIRECT:
+ ss_action_entry_call_internal(PREDEF_POWEROFF, 0);
+ break;
+ case VCONFKEY_SYSMAN_POWER_OFF_POPUP:
+ ss_action_entry_call_internal(PREDEF_PWROFF_POPUP, 0);
+ break;
+ }
+}
+
void ss_predefine_internal_init(void)
{
ss_action_entry_add_internal(PREDEF_FLIGHT_MODE,
flight_mode_def_predefine_action, NULL, NULL);
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (void *)poweroff_control_cb, NULL) < 0) {
+ PRT_TRACE_ERR("Vconf notify key chaneged failed: KEY(%s)", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+ }
ss_action_entry_load_from_sodir();
/* check and set earjack init status */