Battery: add err logs to debug the failure of getting battery level 20/146020/2 submit/tizen_3.0/20170824.124333
authorlokilee73 <changjoo.lee@samsung.com>
Thu, 24 Aug 2017 11:57:23 +0000 (20:57 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Thu, 24 Aug 2017 12:07:29 +0000 (21:07 +0900)
Change-Id: I843d3ae6efe0b1d7acfbdada0936789fed58efec
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/battery.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 6d31483..d58b247
@@ -87,8 +87,10 @@ int device_battery_get_level_status(device_battery_level_e *status)
                return DEVICE_ERROR_INVALID_PARAMETER;
 
        ret = vconf_get_int(VCONFKEY_SYSMAN_BATTERY_LEVEL_STATUS, &val);
-       if (ret < 0)
+       if (ret < 0) {
+               _E("Failed to get vconf (%d)", ret);
                return DEVICE_ERROR_OPERATION_FAILED;
+       }
 
        if (val == VCONFKEY_SYSMAN_BAT_LEVEL_EMPTY)
                *status = DEVICE_BATTERY_LEVEL_EMPTY;
@@ -103,8 +105,10 @@ int device_battery_get_level_status(device_battery_level_e *status)
        /* regard not supported as disconnected */
        else if (val == -ENOTSUP)
                *status = DEVICE_BATTERY_LEVEL_EMPTY;
-       else
+       else {
+               _E("Invalid value (%d)", val);
                return DEVICE_ERROR_OPERATION_FAILED;
+       }
 
        return DEVICE_ERROR_NONE;
 }