*/
#include "popup-common.h"
-#define DEVICED_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti"
-#define DEVICED_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti"
-#define SIGNAL_CHARGEERR_RESPONSE "ChargeErrResponse"
-
-#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-
static const struct popup_ops lowbattery_poweroff_ops;
static const struct popup_ops charge_error_low_ops;
static const struct popup_ops charge_error_high_ops;
static void poweroff_clicked(const struct popup_ops *ops)
{
static int bPowerOff = 0;
- char *param[2];
- char data[8];
+ char *param[1];
int ret;
if (bPowerOff == 1)
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0)
_E("Failed to request poweroff to deviced: %d", ret);
#include "popup-common.h"
-#define DEVICED_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti"
-#define DEVICED_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti"
#define SIGNAL_CHARGEERR_RESPONSE "ChargeErrResponse"
static const struct popup_ops lowbattery_poweroff_ops;
static const struct popup_ops charge_error_high_ops;
static const struct popup_ops battery_disconnected_ops;
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-
static int lowbattery_launch(bundle *b, const struct popup_ops *ops);
static int remove_other_lowbattery_popups(const struct popup_ops *ops)
static void poweroff_clicked(const struct popup_ops *ops)
{
static int bPowerOff = 0;
- char *param[2];
- char data[8];
+ char *param[1];
int ret;
if (bPowerOff == 1)
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0)
_E("Failed to request poweroff to deviced: %d", ret);
}
void change_display_state(void); /* using thread */
void event_back_key_up(void *data, Evas_Object *obj, void *event_info);
+
+/* deviced */
+#define DEVICED_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti"
+#define DEVICED_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti"
+#define SIGNAL_CHARGEERR_RESPONSE "ChargeErrResponse"
+
+#define SYSTEMD_STOP_POWER_OFF 4
+#define DEVICED_BUS_NAME "org.tizen.system.deviced"
+#define POWEROFF_OBJECT_PATH "/Org/Tizen/System/DeviceD/PowerOff"
+#define POWEROFF_INTERFACE_NAME DEVICED_BUS_NAME".PowerOff"
+#define POWEROFF_METHOD "Poweroff"
+
+#define POWEROFF_OPERATION_OFF "poweroff"
+#define POWEROFF_OPERATION_RESTART "reboot"
+
#endif /* __POPUP_COMMON_H__ */
#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti"
-#define DEVICED_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti"
#define SIGNAL_COOL_DOWN_RESPONSE "CoolDownResponse"
#define SIGNAL_COOL_DOWN_CHANGED "CoolDownChanged"
#define COOL_DOWN_RELEASE "Release"
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-
#define TIMEOUT_POWEROFF 10 /* seconds */
#define TIMEOUT_BEEP_40 40 /* seconds */
#define TIMEOUT_BEEP_5 5 /* seconds */
static void cooldown_poweroff(const struct popup_ops *ops)
{
- char *param[2];
- char data[8];
+ char *param[1];
int ret;
_I("Poweroff is selected.");
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0)
_E("Failed to request poweroff to deviced: %d", ret);
#define BUF_MAX 512
#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-
/* Overheat Timer*/
#define OVERHEAT_BUS_NAME "org.tizen.system.popup"
#define OVERHEAT_OBJECT_PATH "/Org/Tizen/System/Popup"
static void overheat_poweroff(const struct popup_ops *ops)
{
static int bPowerOff = 0;
- char *param[2];
- char data[8];
+ char *param[1];
int ret;
if (bPowerOff == 1)
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0)
_E("Failed to request poweroff to deviced: %d", ret);
}
#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-#define REBOOT_OPERATION_RESTART "reboot"
#define TIMEOUT_POWEROFF 5 /* seconds */
#define POWEROFF_KEY "XF86PowerOff"
static void restart_clicked(const struct popup_ops *ops)
{
static int bReset = 0;
- char *param[2];
- char data[8];
+ char *param[1];
int ret;
if (bReset == 1) return;
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_RESTART;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_RESTART;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0) _E("Failed to request restart to deviced: %d", ret);
}
{
static int bPowerOff = 0;
char *param[2];
- char data[8];
int ret;
if (bPowerOff == 1) return;
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0) _E("Failed to request poweroff to deviced: %d", ret);
}
#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
-#define REBOOT_OPERATION_RESTART "reboot"
#define TIMEOUT_POWEROFF 5 /* seconds */
#define POWEROFF_KEY "XF86PowerOff"
{
static int bPowerOff = 0;
char *param[2];
- char data[8];
int ret;
if (bPowerOff == 1) return;
unload_simple_popup(ops);
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0) _E("Failed to request poweroff to deviced: %d", ret);
}
#define SYSTEMD_STOP_POWER_OFF 4
-#define DEVICED_BUS_NAME "org.tizen.system.deviced"
-#define REBOOT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Reboot"
-#define REBOOT_INTERFACE_NAME DEVICED_BUS_NAME".reboot"
-
-#define REBOOT_METHOD "reboot"
-#define REBOOT_OPERATION_OFF "poweroff"
#define TIMEOUT_POWEROFF 5 /* seconds */
#define TELEPHONY_PATH "tizen.org/feature/network.telephony"
{
static int bPowerOff = 0;
char *param[2];
- char data[8];
int ret;
if (bPowerOff == 1) return;
unload_simple_popup(ops);
terminate_if_no_popup();
- param[0] = REBOOT_OPERATION_OFF;
- snprintf(data, sizeof(data), "0");
- param[1] = data;
+ param[0] = POWEROFF_OPERATION_OFF;
ret = popup_dbus_method_sync(DEVICED_BUS_NAME,
- REBOOT_OBJECT_PATH,
- REBOOT_INTERFACE_NAME,
- REBOOT_METHOD,
- "si", param);
+ POWEROFF_OBJECT_PATH,
+ POWEROFF_INTERFACE_NAME,
+ POWEROFF_METHOD,
+ "s", param);
if (ret < 0) _E("Failed to request poweroff to deviced: %d", ret);
}