display: Replace get_lock_screen_state() with vconf API 40/297640/1
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 22 Aug 2023 02:50:36 +0000 (11:50 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 22 Aug 2023 07:20:56 +0000 (16:20 +0900)
The function is dependent to the display/setting.c. To remove that
dependency, added function is_lockscreen_enabled(). Additionally,
the get_lock_screen_bg_state() has been removed as it is not currently
used.

Change-Id: I15c48956b3f34b0397b70a5c4f2f1141671c5c05
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot-headed/display/key-filter.c

index c721b9c..f50af45 100644 (file)
@@ -85,6 +85,16 @@ static int skip_combination = false;
 static int bezel_wakeup = true;
 static int booting_check = true;
 
+static int is_lockscreen_enabled(void)
+{
+       int ret;
+       int enabled;
+
+       ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &enabled);
+
+       return (ret == 0 && enabled) ? VCONFKEY_IDLE_LOCK : VCONFKEY_IDLE_UNLOCK;
+}
+
 static inline int current_state_in_on(void)
 {
        int ret;
@@ -581,12 +591,11 @@ static void process_hardkey_backlight(struct input_event *pinput)
        _E("pinput->value : %d", pinput->value);
        if (pinput->value == KEY_PRESSED) {
                /* Sound & Vibrate only in unlock state */
-               if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
-                   || get_lock_screen_bg_state())
+               if (is_lockscreen_enabled() == VCONFKEY_IDLE_UNLOCK)
                        sound_vibrate_hardkey();
        } else if (pinput->value == KEY_RELEASED) {
                /* if lockscreen is idle lock */
-               if (__get_lock_screen_state() == VCONFKEY_IDLE_LOCK) {
+               if (is_lockscreen_enabled() == VCONFKEY_IDLE_LOCK) {
                        _D("Lock state, key backlight is off when phone is unlocked!");
                        return;
                }