#define APP_COMM "_APP_COMM_"
#define REQ_ID "_REQUEST_ID_"
-#define DBUS_POWER_PATH "/Org/Tizen/System/DeviceD/Power"
-#define DBUS_POWER_IFACE "org.tizen.system.deviced.power"
-#define METHOD_POWER_LOCK_EXPIRED "PowerLockExpired"
+#define DBUS_POWER_BUS "org.tizen.system.deviced"
+#define DBUS_POWER_PATH "/Org/Tizen/System/DeviceD/Display"
+#define DBUS_POWER_IFACE "org.tizen.system.deviced.display"
+#define METHOD_LOCK_TIMEOUT_INPUT "LockTimeoutInput"
static const struct popup_ops power_lock_expired_ops;
-static bool signal_broadcasted;
+static bool result_sended;
static char *request_id;
enum button_selected {
ALLOW_APP,
+ RESTRICT_APP,
CLOSE_APP,
};
-static void send_result_dbus_signal(int result)
+static void send_result(int result)
{
int ret;
char buf[8];
char *param[2];
- if (signal_broadcasted)
+ if (result_sended)
return;
- signal_broadcasted = true;
+ result_sended = true;
param[0] = request_id;
snprintf(buf, sizeof(buf), "%d", result);
param[1] = buf;
- ret = broadcast_dbus_signal(DBUS_POWER_PATH,
+ ret = popup_dbus_method_sync(
+ DBUS_POWER_BUS,
+ DBUS_POWER_PATH,
DBUS_POWER_IFACE,
- METHOD_POWER_LOCK_EXPIRED,
+ METHOD_LOCK_TIMEOUT_INPUT,
"si", param);
if (ret < 0)
- _E("FAIL: broadcast_dbus_signal(%d)", ret);
+ _E("Failed to deliver the result (%d)", ret);
}
static int power_lock_expired_get_content(const struct popup_ops *ops, char *content, unsigned int len)
unload_simple_popup(ops);
- send_result_dbus_signal(ALLOW_APP);
+ send_result(ALLOW_APP);
terminate_if_no_popup();
}
unload_simple_popup(ops);
- send_result_dbus_signal(CLOSE_APP);
+ send_result(CLOSE_APP);
terminate_if_no_popup();
}
static void power_lock_expired_terminate(const struct popup_ops *ops)
{
- send_result_dbus_signal(CLOSE_APP);
- signal_broadcasted = false;
+ send_result(CLOSE_APP);
+ result_sended = false;
}
static const struct popup_ops power_lock_expired_ops = {