There are three functions to get display lock, unlock, state transition by external request.
proc_condition_lock()/proc_condition_unlock()/proc_condition()
Those functions rules are all the same, so they are relocated.
This function is added to display-lock.
- int display_lock_proc_condition(PMMsg *data);
Change-Id: I10dc0f14d3e7b2bc52a0c11fb1e256c986191eec
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
return UNKNOWN_STR;
}
-static void proc_condition_lock(PMMsg *data)
-{
- char pname[PATH_MAX];
- pid_t pid = data->pid;
- enum state_t state;
- int ret;
- bool value = true;
- unsigned int flags;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (state == S_START)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- if ((state == S_LCDOFF) && (get_pm_cur_state() == S_SLEEP) &&
- (pm_get_power_lock() == POWER_UNLOCK))
- display_state_transition_do_proc_change_state(data->cond, INTERNAL_LOCK_PM);
-
- ret = display_lock_request_lock(state, pid, data->timeout);
- if (ret == -EALREADY)
- ret = display_lock_update_lock(state, pid, data->timeout);
-
- if (ret != 0) {
- _E("Failed to acquire lock, state: %d, pid: %d.", state, pid);
- return;
- }
-
- if (state == S_LCDOFF)
- set_process_active(true, pid);
-
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power lock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerLock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerLock.");
- }
- }
-
- _SD("be requested LOCK info pname(%s), flags(%d)",
- pname, flags);
- set_lock_time(pid, pname, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static void proc_condition_unlock(PMMsg *data)
-{
- pid_t pid = data->pid;
- enum state_t state;
- char pname[PATH_MAX];
- bool value = false;
- unsigned int flags;
- int ret;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (!state)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- display_lock_release_lock(state, pid);
-
- if (state == S_LCDOFF)
- set_process_active(false, pid);
-
- _I("[%s] unlocked by %5d", states[state].name, pid);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power unlock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerUnlock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerUnlock.");
- }
- }
-
- _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
- set_unlock_time(pid, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static int proc_condition(PMMsg *data)
-{
- unsigned int flags;
-
- if (IS_COND_REQUEST_LOCK(data->cond))
- proc_condition_lock(data);
-
- if (IS_COND_REQUEST_UNLOCK(data->cond))
- proc_condition_unlock(data);
-
- if (!display_conf.timeout_enable)
- return 0;
-
- flags = GET_COND_FLAG(data->cond);
- if (flags == 0) {
- /* guard time for suspend */
- if (get_pm_cur_state() == S_LCDOFF)
- display_state_transition_reset_state_transition_timeout(states[S_LCDOFF].timeout);
- } else {
- if (flags & PM_FLAG_RESET_TIMER)
- display_state_transition_reset_state_transition_timeout(states[get_pm_cur_state()].timeout);
- }
-
- if (!display_state_transition_is_there_state_transition_timer())
- display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_TIMEOUT);
-
- return 0;
-}
-
/* SIGHUP signal handler
* For debug... print info to syslog
*/
}
if (condition == PM_CONTROL_EVENT) {
- proc_condition(data);
+ display_lock_proc_condition(data);
if (IS_COND_REQUEST_CHANGE(data->cond))
display_state_transition_do_proc_change_state(data->cond, data->pid);
return 0;
}
-static void proc_condition_lock(PMMsg *data)
-{
- char pname[PATH_MAX];
- pid_t pid = data->pid;
- enum state_t state;
- int ret;
- bool value = true;
- unsigned int flags;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (state == S_START)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- if ((state == S_LCDOFF) && (get_pm_cur_state() == S_SLEEP) &&
- (pm_get_power_lock() == POWER_UNLOCK))
- display_state_transition_do_proc_change_state(data->cond, INTERNAL_LOCK_PM);
-
- ret = display_lock_request_lock(state, pid, data->timeout);
- if (ret == -EALREADY)
- ret = display_lock_update_lock(state, pid, data->timeout);
-
- if (ret != 0) {
- _E("Failed to acquire lock, state: %d, pid: %d.", state, pid);
- return;
- }
-
- if (state == S_LCDOFF)
- set_process_active(true, pid);
-
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power lock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerLock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerLock.");
- }
- }
- _SD("be requested LOCK info pname(%s), flags(%d)",
- pname, flags);
- set_lock_time(pid, pname, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static void proc_condition_unlock(PMMsg *data)
-{
- pid_t pid = data->pid;
- enum state_t state;
- char pname[PATH_MAX];
- bool value = false;
- unsigned int flags;
- int ret;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (!state)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- display_lock_release_lock(state, pid);
-
- if (state == S_LCDOFF)
- set_process_active(false, pid);
-
- _I("[%s] unlocked by %5d", states[state].name, pid);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power unlock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerUnlock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerUnlock.");
- }
- }
-
- _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
- set_unlock_time(pid, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static int proc_condition(PMMsg *data)
-{
- unsigned int flags;
-
- if (IS_COND_REQUEST_LOCK(data->cond))
- proc_condition_lock(data);
-
- if (IS_COND_REQUEST_UNLOCK(data->cond))
- proc_condition_unlock(data);
-
- if (!display_conf.timeout_enable)
- return 0;
-
- flags = GET_COND_FLAG(data->cond);
- if (flags == 0) {
- /* guard time for suspend */
- if (get_pm_cur_state() == S_LCDOFF)
- display_state_transition_reset_state_transition_timeout(states[S_LCDOFF].timeout);
- } else {
- if (flags & PM_FLAG_RESET_TIMER)
- display_state_transition_reset_state_transition_timeout(states[get_pm_cur_state()].timeout);
- }
-
- if (!display_state_transition_is_there_state_transition_timer())
- display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_TIMEOUT);
-
- return 0;
-}
-
/* SIGHUP signal handler
* For debug... print info to syslog
*/
}
if (condition == PM_CONTROL_EVENT) {
- proc_condition(data);
+ display_lock_proc_condition(data);
if (IS_COND_REQUEST_CHANGE(data->cond))
display_state_transition_do_proc_change_state(data->cond, data->pid);
return UNKNOWN_STR;
}
-static void proc_condition_lock(PMMsg *data)
-{
- char pname[PATH_MAX];
- pid_t pid = data->pid;
- enum state_t state;
- int ret;
- bool value = true;
- unsigned int flags;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (state == S_START)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- if ((state == S_LCDOFF) && (get_pm_cur_state() == S_SLEEP) &&
- (pm_get_power_lock() == POWER_UNLOCK))
- display_state_transition_do_proc_change_state(data->cond, INTERNAL_LOCK_PM);
-
- ret = display_lock_request_lock(state, pid, data->timeout);
- if (ret == -EALREADY)
- ret = display_lock_update_lock(state, pid, data->timeout);
-
- if (ret != 0) {
- _E("Failed to acquire lock, state: %d, pid: %d.", state, pid);
- return;
- }
-
- if (state == S_LCDOFF)
- set_process_active(true, pid);
-
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power lock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerLock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerLock.");
- }
- }
-
- _SD("be requested LOCK info pname(%s), flags(%d)",
- pname, flags);
- set_lock_time(pid, pname, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static void proc_condition_unlock(PMMsg *data)
-{
- pid_t pid = data->pid;
- enum state_t state;
- char pname[PATH_MAX];
- bool value = false;
- unsigned int flags;
- int ret;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (!state)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- display_lock_release_lock(state, pid);
-
- if (state == S_LCDOFF)
- set_process_active(false, pid);
-
- _I("[%s] unlocked by %5d", states[state].name, pid);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power unlock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerUnlock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerUnlock.");
- }
- }
-
- _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
- set_unlock_time(pid, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static int proc_condition(PMMsg *data)
-{
- unsigned int flags;
-
- if (IS_COND_REQUEST_LOCK(data->cond))
- proc_condition_lock(data);
-
- if (IS_COND_REQUEST_UNLOCK(data->cond))
- proc_condition_unlock(data);
-
- if (!display_conf.timeout_enable)
- return 0;
-
- flags = GET_COND_FLAG(data->cond);
- if (flags == 0) {
- /* guard time for suspend */
- if (get_pm_cur_state() == S_LCDOFF)
- display_state_transition_reset_state_transition_timeout(states[S_LCDOFF].timeout);
- } else {
- if (flags & PM_FLAG_RESET_TIMER)
- display_state_transition_reset_state_transition_timeout(states[get_pm_cur_state()].timeout);
- }
-
- if (!display_state_transition_is_there_state_transition_timer())
- display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_TIMEOUT);
-
- return 0;
-}
-
/* SIGHUP signal handler
* For debug... print info to syslog
*/
}
if (condition == PM_CONTROL_EVENT) {
- proc_condition(data);
+ display_lock_proc_condition(data);
if (IS_COND_REQUEST_CHANGE(data->cond))
display_state_transition_do_proc_change_state(data->cond, data->pid);
return 0;
}
-static void proc_condition_lock(PMMsg *data)
-{
- char pname[PATH_MAX];
- pid_t pid = data->pid;
- enum state_t state;
- int ret;
- bool value = true;
- unsigned int flags;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (state == S_START)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- if ((state == S_LCDOFF) && (get_pm_cur_state() == S_SLEEP) &&
- (pm_get_power_lock() == POWER_UNLOCK))
- display_state_transition_do_proc_change_state(data->cond, INTERNAL_LOCK_PM);
-
- ret = display_lock_request_lock(state, pid, data->timeout);
- if (ret == -EALREADY)
- ret = display_lock_update_lock(state, pid, data->timeout);
-
- if (ret != 0) {
- _E("Failed to acquire lock, state: %d, pid: %d.", state, pid);
- return;
- }
-
- if (state == S_LCDOFF)
- set_process_active(true, pid);
-
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power lock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerLock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerLock.");
- }
- }
-
- _SD("be requested LOCK info pname(%s), flags(%d)",
- pname, flags);
- set_lock_time(pid, pname, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static void proc_condition_unlock(PMMsg *data)
-{
- pid_t pid = data->pid;
- enum state_t state;
- char pname[PATH_MAX];
- bool value = false;
- unsigned int flags;
- int ret;
- const char *lock_type = NULL;
-
- state = GET_COND_STATE(data->cond);
- if (!state)
- return;
-
- flags = GET_COND_FLAG(data->cond);
- display_misc_get_process_name(pid, pname);
-
- display_lock_release_lock(state, pid);
-
- if (state == S_LCDOFF)
- set_process_active(false, pid);
-
- _I("[%s] unlocked by %5d", states[state].name, pid);
-
- if (pid < INTERNAL_LOCK_BASE) {
- /* for debug */
- if (state == S_LCDOFF)
- lock_type = PM_LCDOFF_STR;
- else if (state == S_LCDDIM)
- lock_type = PM_LCDDIM_STR;
- else if (state == S_NORMAL)
- lock_type = PM_LCDON_STR;
-
- if (lock_type) {
- /* power unlock signal */
- ret = gdbus_signal_emit(NULL,
- DEVICED_PATH_DISPLAY,
- DEVICED_INTERFACE_DISPLAY,
- "PowerUnlock",
- g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
- if (ret < 0)
- _E("Failed to send dbus signal PowerUnlock.");
- }
- }
-
- _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
- set_unlock_time(pid, state);
-
- device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
-}
-
-static int proc_condition(PMMsg *data)
-{
- unsigned int flags;
-
- if (IS_COND_REQUEST_LOCK(data->cond))
- proc_condition_lock(data);
-
- if (IS_COND_REQUEST_UNLOCK(data->cond))
- proc_condition_unlock(data);
-
- if (!display_conf.timeout_enable)
- return 0;
-
- flags = GET_COND_FLAG(data->cond);
- if (flags == 0) {
- /* guard time for suspend */
- if (get_pm_cur_state() == S_LCDOFF)
- display_state_transition_reset_state_transition_timeout(states[S_LCDOFF].timeout);
- } else {
- if (flags & PM_FLAG_RESET_TIMER)
- display_state_transition_reset_state_transition_timeout(states[get_pm_cur_state()].timeout);
- }
-
- if (!display_state_transition_is_there_state_transition_timer())
- states[get_pm_cur_state()].trans(EVENT_TIMEOUT);
-
- return 0;
-}
-
/* SIGHUP signal handler
* For debug... print info to syslog
*/
}
if (condition == PM_CONTROL_EVENT) {
- proc_condition(data);
+ display_lock_proc_condition(data);
if (IS_COND_REQUEST_CHANGE(data->cond))
display_state_transition_do_proc_change_state(data->cond, data->pid);
return 0;
}
+
+static void proc_condition_lock(PMMsg *data)
+{
+ char pname[PATH_MAX];
+ pid_t pid = data->pid;
+ enum state_t state;
+ int ret;
+ bool value = true;
+ unsigned int flags;
+ const char *lock_type = NULL;
+ const char *state_name = NULL;
+
+ state = GET_COND_STATE(data->cond);
+ if (state == S_START)
+ return;
+
+ flags = GET_COND_FLAG(data->cond);
+ display_misc_get_process_name(pid, pname);
+
+ if ((state == S_LCDOFF) && (get_pm_cur_state() == S_SLEEP) &&
+ (pm_get_power_lock() == POWER_UNLOCK))
+ display_state_transition_do_proc_change_state(data->cond, INTERNAL_LOCK_PM);
+
+ ret = display_lock_request_lock(state, pid, data->timeout);
+ if (ret == -EALREADY)
+ ret = display_lock_update_lock(state, pid, data->timeout);
+
+ if (ret != 0) {
+ _E("Failed to acquire lock, state: %d, pid: %d.", state, pid);
+ return;
+ }
+
+ if (state == S_LCDOFF)
+ set_process_active(true, pid);
+
+ display_plugin_state_get_name(state, &state_name);
+ _I("[%s] locked by %5d with %u ms", state_name, pid, data->timeout);
+
+ if (pid < INTERNAL_LOCK_BASE) {
+ /* for debug */
+ if (state == S_LCDOFF)
+ lock_type = PM_LCDOFF_STR;
+ else if (state == S_LCDDIM)
+ lock_type = PM_LCDDIM_STR;
+ else if (state == S_NORMAL)
+ lock_type = PM_LCDON_STR;
+
+ if (lock_type) {
+ /* power lock signal */
+ ret = gdbus_signal_emit(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerLock",
+ g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerLock.");
+ }
+ }
+
+ _SD("be requested LOCK info pname(%s), flags(%d)", pname, flags);
+ set_lock_time(pid, pname, state);
+
+ device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
+}
+
+static void proc_condition_unlock(PMMsg *data)
+{
+ pid_t pid = data->pid;
+ enum state_t state;
+ char pname[PATH_MAX];
+ bool value = false;
+ unsigned int flags;
+ int ret;
+ const char *lock_type = NULL;
+ const char *state_name = NULL;
+
+ state = GET_COND_STATE(data->cond);
+ if (!state)
+ return;
+
+ flags = GET_COND_FLAG(data->cond);
+ display_misc_get_process_name(pid, pname);
+
+ display_lock_release_lock(state, pid);
+
+ if (state == S_LCDOFF)
+ set_process_active(false, pid);
+
+ display_plugin_state_get_name(state, &state_name);
+ _I("[%s] unlocked by %5d", state_name, pid);
+
+ if (pid < INTERNAL_LOCK_BASE) {
+ /* for debug */
+ if (state == S_LCDOFF)
+ lock_type = PM_LCDOFF_STR;
+ else if (state == S_LCDDIM)
+ lock_type = PM_LCDDIM_STR;
+ else if (state == S_NORMAL)
+ lock_type = PM_LCDON_STR;
+
+ if (lock_type) {
+ /* power unlock signal */
+ ret = gdbus_signal_emit(NULL,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ "PowerUnlock",
+ g_variant_new("(sii)", lock_type, pid, (int)data->timeout));
+ if (ret < 0)
+ _E("Failed to send dbus signal PowerUnlock.");
+ }
+ }
+
+ _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags);
+ set_unlock_time(pid, state);
+
+ device_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value);
+}
+
+/* FIXME: This function will be refactored or divided according to role */
+int display_lock_proc_condition(PMMsg *data)
+{
+ unsigned int flags;
+ int timeout = 0;
+ bool timeout_enable = false;
+
+ if (IS_COND_REQUEST_LOCK(data->cond))
+ proc_condition_lock(data);
+
+ if (IS_COND_REQUEST_UNLOCK(data->cond))
+ proc_condition_unlock(data);
+
+ display_plugin_config_get_timeout_enable(&timeout_enable);
+ if (!timeout_enable)
+ return 0;
+
+ flags = GET_COND_FLAG(data->cond);
+ if (flags == 0) {
+ /* guard time for suspend */
+ if (get_pm_cur_state() == S_LCDOFF) {
+ display_plugin_state_get_timeout(S_LCDOFF, &timeout);
+ display_state_transition_reset_state_transition_timeout(timeout);
+ }
+ } else {
+ if (flags & PM_FLAG_RESET_TIMER) {
+ display_plugin_state_get_timeout(get_pm_cur_state(), &timeout);
+ display_state_transition_reset_state_transition_timeout(timeout);
+ }
+ }
+
+ if (!display_state_transition_is_there_state_transition_timer())
+ display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_TIMEOUT);
+
+ return 0;
+}
\ No newline at end of file
int display_lock_is_state_locked(enum state_t state);
int display_lock_print_lock_info(int fd);
+int display_lock_proc_condition(PMMsg *data);
+
#endif /* __DISPLAY_LOCK_H__ */