Added a feature that enables/disables the lockscreen logic according to the profile's configuration
because the lockscreen is not always a necessary function.
int display_config_get_lockscreen_disable(bool *lockscreen_disable);
To get lockscreen configuration info, above function is added.
Change-Id: Ie36bcb1ae5621ca69382fac55ecb900c743c0949
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
return 0;
}
+
+int display_config_get_lockscreen_disable(bool *lockscreen_disable)
+{
+ if (!lockscreen_disable)
+ return -EINVAL;
+
+ if (!g_display_config)
+ return -ENOSYS;
+
+ *lockscreen_disable = g_display_config->lockscreen_disable;
+
+ return 0;
+}
int display_config_get_lcd_always_on(int *lcd_always_on);
int display_config_get_dimming(int *dimming);
int display_config_get_pm_default_brightness(int *pm_default_brightness);
+int display_config_get_lockscreen_disable(bool *lockscreen_disable);
#endif //__DISPLAY_CONFIG_H__
previous = state;
}
+static bool is_possible_to_set_lock_screen_timeout(void)
+{
+ int ret = 0;
+ int lockscreen = 0;
+ bool lockscreen_disable = false;
+
+ ret = display_config_get_lockscreen_disable(&lockscreen_disable);
+ if (ret < 0) {
+ _E("Failed to get lockscreen disable value, ret(%d)", ret);
+ return false;
+ }
+
+ if (lockscreen_disable == true) {
+ _I("lockscreen is disabled, skip getting lockscreen timeout value");
+ return false;
+ }
+
+ ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lockscreen);
+ if (ret < 0) {
+ _E("Failed to get lockscreen state, ret(%d)", ret);
+ return false;
+ }
+
+ if (lockscreen == VCONFKEY_IDLE_UNLOCK) {
+ _I("lockscreen is not being displayed. skip setting lock screen timeout value");
+ return false;
+ }
+
+ return true;
+}
+
/**
* Default policy for display state timeout.
*/
{
double display_on_ratio = 1.0;
double display_dim_ratio = 0.0;
- int lockscreen = 0;
int screen_timeout = 0;
int dimming = 0;
int ret = 0;
if (ret < 0)
return ret;
- /* If lockscreen is being displayed, use lockscreen timeout instead. */
- ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lockscreen);
- if (ret == 0 && lockscreen == VCONFKEY_IDLE_LOCK)
+ if (is_possible_to_set_lock_screen_timeout())
screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
/* If dimming enabled, devide screen timeout into
int ret = -1;
int lock_state = 0;
int lock_screen_timeout = 0;
+ bool lockscreen_disable = false;
+
+ ret = display_config_get_lockscreen_disable(&lockscreen_disable);
+ if (ret < 0)
+ _W("Cannot get lockscreen disable configuration, ret(%d)", ret);
+
+ if (lockscreen_disable == true) {
+ _I("Lockscreen is disabled by configuration. Skip the initial lock screen status.");
+ return;
+ }
ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock_state);
if (ret < 0) {
static void process_touchkey_enable(bool enable)
{
int lockscreen_state = VCONFKEY_IDLE_UNLOCK;
+ bool lockscreen_disable = false;
+ int ret = 0;
/* release existing timer */
if (hardkey_timeout_id > 0) {
/* turn on hardkey backlight */
touchled_set_state(true);
- /* do not create turnoff timer in case of idle lock state */
- syscommon_resman_get_resource_attr_int(
- SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_LOCKSCREEN_STATE, &lockscreen_state);
- if (lockscreen_state == VCONFKEY_IDLE_LOCK)
- return;
+ ret = display_config_get_lockscreen_disable(&lockscreen_disable);
+ if (ret < 0)
+ _W("Cannot get lockscreen disable configuration, ret(%d)", ret);
+
+ if (lockscreen_disable == false) {
+ /* do not create turnoff timer in case of idle lock state */
+ syscommon_resman_get_resource_attr_int(
+ SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+ DEVICED_DISPLAY_ATTR_INT_LOCKSCREEN_STATE, &lockscreen_state);
+ if (lockscreen_state == VCONFKEY_IDLE_LOCK)
+ return;
+ }
/* start timer */
hardkey_timeout_id = g_timeout_add_seconds(