Below keys depend on battery module.
If there is no battery in target,
runtime-info regards battery keys as disconnected.
RUNTIME_INFO_KEY_CHARGER_CONNECTED
RUNTIME_INFO_KEY_BATTERY_IS_CHARGING
Change-Id: I6138f1ffe03d3d0821f66e713947205712e55bae
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
{
runtime_info_item_h runtime_info_item;
runtime_info_func_get_value get_value;
{
runtime_info_item_h runtime_info_item;
runtime_info_func_get_value get_value;
if (runtime_info_get_item(key, &runtime_info_item)) {
LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
if (runtime_info_get_item(key, &runtime_info_item)) {
LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_IO_ERROR;
}
return RUNTIME_INFO_ERROR_IO_ERROR;
}
- if (get_value(value) != RUNTIME_INFO_ERROR_NONE) {
- LOGE("IO_ERROR(0x%08x) : failed to get the runtime informaion / key(%d)", RUNTIME_INFO_ERROR_IO_ERROR, key);
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ ret = get_value(value);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ LOGE("ERROR(0x%08x) : fail to get the runtime information / key(%d)", ret, key);
+ return ret;
}
return RUNTIME_INFO_ERROR_NONE;
}
return RUNTIME_INFO_ERROR_NONE;
if (runtime_info_vconf_get_value_int(VCONF_BATTERY_CHARGING, &vconf_value))
return RUNTIME_INFO_ERROR_IO_ERROR;
if (runtime_info_vconf_get_value_int(VCONF_BATTERY_CHARGING, &vconf_value))
return RUNTIME_INFO_ERROR_IO_ERROR;
+ /* regard not supported as disconnected */
+ if (vconf_value == -ENOTSUP)
+ vconf_value = false;
+
value->b = vconf_value;
return RUNTIME_INFO_ERROR_NONE;
value->b = vconf_value;
return RUNTIME_INFO_ERROR_NONE;
switch (vconf_value) {
case VCONFKEY_SYSMAN_CHARGER_DISCONNECTED:
switch (vconf_value) {
case VCONFKEY_SYSMAN_CHARGER_DISCONNECTED:
+ /* regard not supported as disconnected */
+ case -ENOTSUP: