#include <fnmatch.h>
#include <vconf-keys.h>
#include <sys/time.h>
+#include <device/power.h>
#include "ambient-mode.h"
#include "util.h"
DEVICED_PATH_DISPLAY,
DEVICED_INTERFACE_DISPLAY,
"sleep",
- g_variant_new("(t)", (guint64)now));;
+ g_variant_new("(t)", (guint64)now));
if (ret < 0)
_E("Failed to send dbus signal sleep.");
}
char pname[PATH_MAX];
pid_t pid = data->pid;
enum state_t state;
- int holdkey_block;
+ int holdkey_block, ret;
bool value = true;
unsigned int flags;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (state == S_START)
_I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power lock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerLock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerLock.");
+
+skip_broadcast_signal:
_SD("be requested LOCK info pname(%s), holdkeyblock(%d) flags(%d)",
pname, holdkey_block, flags);
set_lock_time(pid, pname, state);
char pname[PATH_MAX];
bool value = false;
unsigned int flags;
+ int ret;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (!state)
_I("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power unlock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerUnlock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerUnlock.");
+
+skip_broadcast_signal:
_SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
set_unlock_time(pid, state);
#include <fnmatch.h>
#include <vconf-keys.h>
#include <sys/time.h>
+#include <device/power.h>
#include "ambient-mode.h"
#include "util.h"
char pname[PATH_MAX];
pid_t pid = data->pid;
enum state_t state;
- int holdkey_block;
+ int holdkey_block,ret;
bool value = true;
unsigned int flags;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (state == S_START)
_I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power lock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerLock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerLock.");
+
+skip_broadcast_signal:
_SD("be requested LOCK info pname(%s), holdkeyblock(%d) flags(%d)",
pname, holdkey_block, flags);
set_lock_time(pid, pname, state);
char pname[PATH_MAX];
bool value = false;
unsigned int flags;
+ int ret;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (!state)
_I("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power unlock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerUnlock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerUnlock.");
+
+skip_broadcast_signal:
_SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
set_unlock_time(pid, state);
#include <fnmatch.h>
#include <vconf-keys.h>
#include <sys/time.h>
+#include <device/power.h>
#include "ambient-mode.h"
#include "util.h"
char pname[PATH_MAX];
pid_t pid = data->pid;
enum state_t state;
- int holdkey_block;
+ int holdkey_block, ret;
bool value = true;
unsigned int flags;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (state == S_START)
_I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power lock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerLock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerLock.");
+
+skip_broadcast_signal:
_SD("be requested LOCK info pname(%s), holdkeyblock(%d) flags(%d)",
pname, holdkey_block, flags);
set_lock_time(pid, pname, state);
char pname[PATH_MAX];
bool value = false;
unsigned int flags;
+ int ret;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (!state)
_I("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power unlock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerUnlock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerUnlock.");
+
+skip_broadcast_signal:
_SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
set_unlock_time(pid, state);
#include <fnmatch.h>
#include <vconf-keys.h>
#include <sys/time.h>
+#include <device/power.h>
#include "ambient-mode.h"
#include "util.h"
char pname[PATH_MAX];
pid_t pid = data->pid;
enum state_t state;
- int holdkey_block;
+ int holdkey_block, ret;
bool value = true;
unsigned int flags;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (state == S_START)
_I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power lock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerLock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerLock.");
+
+skip_broadcast_signal:
_SD("be requested LOCK info pname(%s), holdkeyblock(%d) flags(%d)",
pname, holdkey_block, flags);
set_lock_time(pid, pname, state);
char pname[PATH_MAX];
bool value = false;
unsigned int flags;
+ int ret;
+ power_lock_e lock_type;
state = GET_COND_STATE(data->cond);
if (!state)
_I("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
+ if (state == S_LCDOFF)
+ lock_type = POWER_LOCK_CPU;
+ else if (state == S_LCDDIM)
+ lock_type = POWER_LOCK_DISPLAY_DIM;
+ else if (state == S_NORMAL)
+ lock_type = POWER_LOCK_DISPLAY;
+ else
+ goto skip_broadcast_signal;
+
+ /* power unlock signal */
+ ret = dbus_handle_emit_dbus_signal(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerUnlock",
+ g_variant_new("(iii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerUnlock.");
+
+skip_broadcast_signal:
_SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
set_unlock_time(pid, state);