Get lockscreen bg state for backlight time. 93/15193/1
authorsh.pi <sh.pi@samsung.com>
Tue, 18 Jun 2013 07:38:17 +0000 (16:38 +0900)
committerKrzysztof Sasiak <k.sasiak@samsung.com>
Thu, 16 Jan 2014 17:07:04 +0000 (18:07 +0100)
Backlight time is 5 second in lock state normally.
But there is exceptional state in lock state.
In SOS call or other state, It's normal backlight time in spite of lock state.
Then deviced get background state of lockscreen for exceptional state.

Change-Id: I5ed635bb9ccfcd4c4dc6975ace6bf839187ef376
Signed-off-by: Krzysztof Sasiak <k.sasiak@samsung.com>
src/display/core.c
src/display/display-dbus.c
src/display/setting.c
src/display/setting.h

index e92fb95..ff2f28f 100644 (file)
@@ -1209,6 +1209,12 @@ static int update_setting(int key_idx, int val)
                        states[pm_cur_state].trans(EVENT_INPUT);
                }
                break;
+       case SETTING_LOCK_SCREEN_BG:
+               set_lock_screen_bg_state(val);
+               if (pm_cur_state == S_NORMAL) {
+                       states[pm_cur_state].trans(EVENT_INPUT);
+               }
+               break;
        case SETTING_POWER_SAVING:
                if (val == 1)
                        vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_DISPLAY,
index 06f1a29..18f8800 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include <error.h>
+#include <stdbool.h>
 #include <Ecore.h>
 #include <device-node.h>
 
@@ -371,7 +372,38 @@ error:
        return reply;
 }
 
-static struct edbus_method {
+static DBusMessage *e_dbus_lockscreenbgon(E_DBus_Object *obj, DBusMessage *msg)
+{
+       DBusMessageIter iter;
+       DBusMessage *reply;
+       int ret = 0;
+       char *on;
+
+       ret = dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &on,
+                   DBUS_TYPE_INVALID);
+
+       if (!ret) {
+               _E("fail to update lcdscreen bg on state %d", ret);
+               ret = -EINVAL;
+               goto error;
+       }
+
+       if (!strcmp(on, "true"))
+               update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
+       else if (!strcmp(on, "false"))
+               update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
+       else
+               ret = -EINVAL;
+
+error:
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_iter_init_append(reply, &iter);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+
+       return reply;
+}
+
+static const struct edbus_method {
        const char *member;
        const char *signature;
        const char *reply_signature;
@@ -388,6 +420,7 @@ static struct edbus_method {
        { "getautobrightnessinterval",  NULL,   "i", e_dbus_getautobrightnessinterval },
        { "setautobrightnessinterval",   "i",   "i", e_dbus_setautobrightnessinterval },
        { "setautobrightnessmin", "i", "i", e_dbus_setautobrightnessmin },
+       { "LockScreenBgOn", "s", "i", e_dbus_lockscreenbgon },
        /* Add methods here */
 };
 
index fe538e4..48a1bbc 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <stdbool.h>
 
 #include "display/util.h"
 #include "setting.h"
@@ -34,6 +35,7 @@ static const char *setting_keys[SETTING_GET_END] = {
 };
 
 static int lock_screen_state = VCONFKEY_IDLE_UNLOCK;
+static bool lock_screen_bg_state = false;
 
 int (*update_pm_setting) (int key_idx, int val);
 
@@ -54,6 +56,17 @@ void set_lock_screen_state(int state)
        }
 }
 
+int get_lock_screen_bg_state(void)
+{
+       return lock_screen_bg_state;
+}
+
+void set_lock_screen_bg_state(bool state)
+{
+       _I("state is %d", state);
+       lock_screen_bg_state = state;
+}
+
 int get_charging_status(int *val)
 {
        return vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, val);
index 591ce8a..f66b260 100644 (file)
@@ -43,6 +43,7 @@ enum {
        SETTING_LOW_BATT,
        SETTING_CHARGING,
        SETTING_POWEROFF,
+       SETTING_LOCK_SCREEN_BG,
        SETTING_END
 };