return g_variant_new("(i)", ret);
}
+static GVariant *dbus_power_get_state(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ return g_variant_new("(t)", power_get_state());
+}
+
static const dbus_method_s dbus_methods[] = {
{ "LockCpu", "i", "i", dbus_power_lock_cpu },
{ "UnlockCpu", NULL, "i", dbus_power_unlock_cpu },
{ "RemoveChangeStateWait", "t", NULL, dbus_power_remove_change_state_wait },
{ "ConfirmChangeStateWait", "t", "i", dbus_power_confirm_change_state_wait },
{ "PowerChangeState", "t", "i", dbus_power_change_state },
+ { "PowerGetState", NULL, "t", dbus_power_get_state },
/* Add methods here */
};
static int power_transition_state(void *data);
+uint64_t power_get_state(void)
+{
+ return current;
+}
+
static void power_wake_unlock(void *udata)
{
/* for POWER_STATE_NORMAL, POWER_STATE_POWEROFF, do not wake unlock */