#define SIGNAL_COOL_DOWN_CHANGED "CoolDownChanged"
#define COOL_DOWN_RELEASE "Release"
+#define POWER_BUS_NAME "org.tizen.system.deviced"
+#define POWER_OBJECT_PATH "/Org/Tizen/System/DeviceD/Power"
+#define POWER_INTERFACE_NAME POWER_BUS_NAME".power"
+
+#define POWER_METHOD "reboot"
+#define POWER_OPERATION_OFF "poweroff"
+
#define TIMEOUT_POWEROFF 10 /* seconds */
#define TIMEOUT_BEEP_40 40 /* seconds */
#define TIMEOUT_BEEP_5 5 /* seconds */
if (!release_handler)
return;
+
conn = get_dbus_connection();
if (!conn) {
release_handler = NULL;
static void cooldown_poweroff(const struct popup_ops *ops)
{
- _I("Poweroff is selected");
+ char *param[2];
+ char data[8];
+ int ret;
- unload_simple_popup(ops);
+ param[0] = POWER_OPERATION_OFF;
+ snprintf(data, sizeof(data), "0");
+ param[1] = data;
- if (vconf_set_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS,
- SYSTEMD_STOP_POWER_OFF) != 0)
- _E("Failed to request poweroff to deviced");
+ ret = popup_dbus_method_sync(POWER_BUS_NAME,
+ POWER_OBJECT_PATH,
+ POWER_INTERFACE_NAME,
+ POWER_METHOD,
+ "si", param);
+
+ if (ret < 0)
+ _E("Failed to request poweroff to deviced (%d)", ret);
terminate_if_no_popup();
}
int ret;
remove_other_popups(ops);
-
if (timer)
ecore_timer_del(timer);
timer = ecore_timer_add(TIMEOUT_BEEP_40, beep_time_expired, ops);
+
if (!timer)
_E("Failed to add timer");
const struct popup_ops *ops = data;
cooldown_poweroff(ops);
-
return ECORE_CALLBACK_CANCEL;
}
if (timer)
ecore_timer_del(timer);
+
timer = ecore_timer_add(TIMEOUT_POWEROFF, poweroff_time_expired, ops);
if (!timer)
_E("Failed to add timer");
.get_content = cooldown_poweroff_content,
.left_text = "IDS_COM_SK_OK",
.left = cooldown_poweroff,
- .show = cooldown_poweroff_timer,
+ .pre = cooldown_poweroff_timer,
.terminate = cooldown_poweroff,
};
.get_content = cooldown_warning_content,
.left_text = "IDS_COM_SK_OK",
.left = cooldown_warning,
- .show = cooldown_warning_timer,
+ .pre = cooldown_warning_timer,
.terminate = cooldown_warning,
};