To remove build dependency, custom_holdkey_block variable should be moved to display-lock.
And then, custom_holdkey_block getter/setter is added.
void display_lock_set_custom_holdkey_block(bool blocked);
void display_lock_get_custom_holdkey_block(bool *blocked);
custom_holdkey_block is set through the dbus method dbus_setlcdtimeout.
This variable is used for screenlock, lcdoff process.
Change-Id: If8b19fd66d388271ccc51c327302ed00196097f7
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
static int system_wakeup_flag = false;
static unsigned int custom_normal_timeout = 0;
static unsigned int custom_dim_timeout = 0;
-int custom_holdkey_block = false;
static char *custom_change_name;
static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
states[get_pm_cur_state()].trans(EVENT_INPUT);
if (holdkey_block) {
- custom_holdkey_block = true;
+ display_lock_set_custom_holdkey_block(true);
_I("Hold key disabled.");
} else {
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
_I("Hold key enabled.");
}
if (!custom_change_name) {
_E("Failed to malloc.");
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
return -ENOMEM;
}
free(custom_change_name);
custom_change_name = 0;
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
update_display_time();
if (get_pm_cur_state() == S_NORMAL)
static int system_wakeup_flag = false;
static unsigned int custom_normal_timeout = 0;
static unsigned int custom_dim_timeout = 0;
-int custom_holdkey_block = false;
static char *custom_change_name;
static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
states[get_pm_cur_state()].trans(EVENT_INPUT);
if (holdkey_block) {
- custom_holdkey_block = true;
+ display_lock_set_custom_holdkey_block(true);
_I("Hold key disabled.");
} else {
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
_I("Hold key enabled.");
}
if (!custom_change_name) {
_E("Failed to malloc.");
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
return -ENOMEM;
}
free(custom_change_name);
custom_change_name = 0;
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
update_display_time();
if (get_pm_cur_state() == S_NORMAL)
static int system_wakeup_flag = false;
static unsigned int custom_normal_timeout = 0;
static unsigned int custom_dim_timeout = 0;
-int custom_holdkey_block = false;
static char *custom_change_name;
static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
states[get_pm_cur_state()].trans(EVENT_INPUT);
if (holdkey_block) {
- custom_holdkey_block = true;
+ display_lock_set_custom_holdkey_block(true);
_I("Hold key disabled.");
} else {
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
_I("Hold key enabled.");
}
if (!custom_change_name) {
_E("Failed to malloc.");
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
return -ENOMEM;
}
free(custom_change_name);
custom_change_name = 0;
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
update_display_time();
if (get_pm_cur_state() == S_NORMAL)
static int system_wakeup_flag = false;
static unsigned int custom_normal_timeout = 0;
static unsigned int custom_dim_timeout = 0;
-int custom_holdkey_block = false;
static char *custom_change_name;
static guint lock_timeout_id;
static guint transit_timer;
states[get_pm_cur_state()].trans(EVENT_INPUT);
if (holdkey_block) {
- custom_holdkey_block = true;
+ display_lock_set_custom_holdkey_block(true);
_I("Hold key disabled.");
} else {
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
_I("Hold key enabled.");
}
if (!custom_change_name) {
_E("Failed to malloc.");
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
return -ENOMEM;
}
free(custom_change_name);
custom_change_name = 0;
custom_normal_timeout = custom_dim_timeout = 0;
- custom_holdkey_block = false;
+ display_lock_set_custom_holdkey_block(false);
update_display_time();
if (get_pm_cur_state() == S_NORMAL)
static GList *cond_head[S_END];
static int trans_condition;
+static bool custom_holdkey_block = false;
bool check_lock_state(int state)
{
g_source_remove(node->timeout_id);
node->timeout_id = timeout_id;
}
+
+int display_lock_set_custom_holdkey_block(bool blocked)
+{
+ custom_holdkey_block = blocked;
+ return 0;
+}
+
+int display_lock_get_custom_holdkey_block(bool *blocked)
+{
+ if (!blocked)
+ return -EINVAL;
+
+ *blocked = custom_holdkey_block;
+ return 0;
+}
+
int display_app_foreground(void *data);
int display_app_terminated(void *data);
void update_lock_timer(PMMsg *data, PmLockNode *node, guint timeout_id);
-extern int custom_holdkey_block;
+
+int display_lock_set_custom_holdkey_block(bool blocked);
+int display_lock_get_custom_holdkey_block(bool *blocked);
#endif /* __DISPLAY_LOCK_H__ */