Display: to remove a log for privilege check 56/162556/3
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 4 Dec 2017 07:51:16 +0000 (16:51 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 4 Dec 2017 10:26:15 +0000 (19:26 +0900)
Change-Id: If12e3e6daebae37900e9d41b55065591e8aec6e6
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/power.c

index 6678264..b585325 100755 (executable)
@@ -331,10 +331,6 @@ static int lock_state(display_state_e state, unsigned int flag, int timeout_ms)
        char str_timeout[32];
        int ret;
 
-       arr[0] = get_state_str(state);
-       if (!arr[0])
-               return -EINVAL;
-
        if (flag & GOTO_STATE_NOW)
                arr[1] = STR_GOTOSTATENOW;
        else
@@ -347,16 +343,20 @@ static int lock_state(display_state_e state, unsigned int flag, int timeout_ms)
        else
                arr[2] = STR_NULL;
 
-       snprintf(str_timeout, sizeof(str_timeout), "%d", -1);
+       snprintf(str_timeout, sizeof(str_timeout), "%d", timeout_ms);
        arr[3] = str_timeout;
+
+       arr[0] = "privilege check";
+
        ret = dbus_method_sync(DEVICED_BUS_NAME,
                        DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
                        METHOD_LOCK_STATE, "sssi", arr);
        if (ret == -EACCES || ret == -ECOMM || ret == -EPERM)
                return -EACCES;
 
-       snprintf(str_timeout, sizeof(str_timeout), "%d", timeout_ms);
-       arr[3] = str_timeout;
+       arr[0] = get_state_str(state);
+       if (!arr[0])
+               return -EINVAL;
 
        return dbus_method_async_with_reply(DEVICED_BUS_NAME,
                        DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
@@ -381,8 +381,17 @@ static int unlock_state(display_state_e state, unsigned int flag)
        char *arr[2];
        int ret;
 
-       arr[0] = "";
-       arr[1] = "";
+       if (flag == PM_SLEEP_MARGIN)
+               arr[1] = STR_SLEEP_MARGIN;
+       else if (flag == PM_RESET_TIMER)
+               arr[1] = STR_RESET_TIMER;
+       else if (flag == PM_KEEP_TIMER)
+               arr[1] = STR_KEEP_TIMER;
+       else
+               return -EINVAL;
+
+       arr[0] = "privilege check";
+
        ret = dbus_method_sync(DEVICED_BUS_NAME,
                        DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
                        METHOD_UNLOCK_STATE, "ss", arr);
@@ -393,15 +402,6 @@ static int unlock_state(display_state_e state, unsigned int flag)
        if (!arr[0])
                return -EINVAL;
 
-       if (flag == PM_SLEEP_MARGIN)
-               arr[1] = STR_SLEEP_MARGIN;
-       else if (flag == PM_RESET_TIMER)
-               arr[1] = STR_RESET_TIMER;
-       else if (flag == PM_KEEP_TIMER)
-               arr[1] = STR_KEEP_TIMER;
-       else
-               return -EINVAL;
-
        return dbus_method_async_with_reply(DEVICED_BUS_NAME,
                        DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
                        METHOD_UNLOCK_STATE, "ss", arr, unlock_cb, -1, NULL);