error type: add error type RUNTIME_INFO_ERROR_NOT_SUPPORTED 14/40714/2
authorTaeyoung Kim <ty317.kim@samsung.com>
Mon, 8 Jun 2015 09:33:06 +0000 (18:33 +0900)
committerTaeyoung Kim <ty317.kim@samsung.com>
Mon, 8 Jun 2015 09:44:53 +0000 (18:44 +0900)
- when vconf key does not exist, the feature related with the vconf key
  is not supported. Thus NOT_SUPPORTED error type is added

Change-Id: I542e4981bb5ee32d2b656b9ef79c0ede1896fba5
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
include/runtime_info.h
src/runtime_info.c
src/runtime_info_connectivity.c
src/runtime_info_location.c
src/runtime_info_system.c
src/runtime_info_vconf.c

index 439f997..78e7d38 100644 (file)
@@ -33,11 +33,13 @@ extern "C"
  * @brief Enumeration for error codes for runtime information.
  */
 typedef enum {
-       RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE,                                                             /**< Successful */
+       RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE,                             /**< Successful */
        RUNTIME_INFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,   /**< Invalid parameter */
-       RUNTIME_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,                   /**< Out of memory */
-       RUNTIME_INFO_ERROR_IO_ERROR =  TIZEN_ERROR_IO_ERROR,                                    /**< An input/output error occurred when read value from system */
+       RUNTIME_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,           /**< Out of memory */
+       RUNTIME_INFO_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR,                     /**< An input/output error occurred when read value from system */
+       RUNTIME_INFO_ERROR_REMOTE_IO = TIZEN_ERROR_REMOTE_IO,                   /**< Remote I/O error occured */
        RUNTIME_INFO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,   /**< No permission to use the api */
+       RUNTIME_INFO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,                   /**< Not supported parameter @if MOBILE (Since 2.3.1) @endif */
 } runtime_info_error_e;
 
 /**
@@ -146,6 +148,7 @@ typedef void (*runtime_info_changed_cb)(runtime_info_key_e key, void *user_data)
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
  */
 int runtime_info_get_value_int(runtime_info_key_e key, int *value);
 
@@ -165,6 +168,7 @@ int runtime_info_get_value_int(runtime_info_key_e key, int *value);
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
  */
 int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
 
@@ -184,6 +188,7 @@ int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
  */
 int runtime_info_get_value_double(runtime_info_key_e key, double *value);
 
@@ -206,6 +211,7 @@ int runtime_info_get_value_double(runtime_info_key_e key, double *value);
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_OUT_OF_MEMORY     Out of memory
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
  */
 int runtime_info_get_value_string(runtime_info_key_e key, char **value);
 
@@ -224,6 +230,7 @@ int runtime_info_get_value_string(runtime_info_key_e key, char **value);
  * @retval  #RUNTIME_INFO_ERROR_NONE              Successful
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
  * @post runtime_info_changed_cb() will be invoked.
  *
  * @see runtime_info_unset_changed_cb()
index d90bf94..f07855d 100644 (file)
@@ -344,12 +344,10 @@ int runtime_info_get_value(runtime_info_key_e key, runtime_info_data_type_e data
        }
 
        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;
-       }
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               LOGE("IO_ERROR(0x%08x) : failed to get the runtime informaion / key(%d)", ret, key);
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 API int runtime_info_get_value_int(runtime_info_key_e key, int *value)
index d6c3ffc..ca7c257 100644 (file)
@@ -80,9 +80,11 @@ void runtime_info_wifi_status_unset_event_cb()
 int runtime_info_bt_enabled_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_BT_ENABLED, &vconf_value))
-               vconf_value = VCONFKEY_BT_STATUS_OFF;
+       ret = runtime_info_vconf_get_value_int(VCONF_BT_ENABLED, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_BT_STATUS_OFF:
@@ -99,7 +101,7 @@ int runtime_info_bt_enabled_get_value(runtime_info_value_h value)
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_bt_enabled_set_event_cb()
@@ -116,13 +118,13 @@ void runtime_info_bt_enabled_unset_event_cb()
 int runtime_info_wifi_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_WIFI_HOTSPOT_ENABLED, &vconf_value))
-               vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
-
-       value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) ? true : false;
+       ret = runtime_info_vconf_get_value_int(VCONF_WIFI_HOTSPOT_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) ? true : false;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_wifi_hotspot_set_event_cb()
@@ -138,13 +140,13 @@ void runtime_info_wifi_hotspot_unset_event_cb()
 int runtime_info_bt_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_BT_HOTSPOT_ENABLED, &vconf_value))
-               vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
+       ret = runtime_info_vconf_get_value_int(VCONF_BT_HOTSPOT_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_BT) ? true : false;
 
-       value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_BT) ? true : false;
-
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_bt_hotspot_set_event_cb()
@@ -160,13 +162,13 @@ void runtime_info_bt_hotspot_unset_event_cb()
 int runtime_info_usb_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_USB_HOTSPOT_ENABLED, &vconf_value))
-               vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
-
-       value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_USB) ? true : false;
+       ret = runtime_info_vconf_get_value_int(VCONF_USB_HOTSPOT_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_USB) ? true : false;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_usb_hotspot_set_event_cb()
@@ -182,13 +184,13 @@ void runtime_info_usb_hotspot_unset_event_cb()
 int runtime_info_packet_data_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_bool(VCONF_PACKET_DATA_ENABLED, &vconf_value))
-               vconf_value = 0;
-
-       value->b = (bool)vconf_value;
+       ret = runtime_info_vconf_get_value_bool(VCONF_PACKET_DATA_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (bool)vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_packet_data_set_event_cb()
@@ -204,13 +206,13 @@ void runtime_info_packet_data_unset_event_cb()
 int runtime_info_data_roaming_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_bool(VCONF_DATA_ROAMING_ENABLED, &vconf_value))
-               vconf_value = 0;
+       ret = runtime_info_vconf_get_value_bool(VCONF_DATA_ROAMING_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (bool)vconf_value;
 
-       value->b = (bool)vconf_value;
-
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_data_roaming_set_event_cb()
@@ -226,9 +228,11 @@ void runtime_info_data_roaming_unset_event_cb()
 int runtime_info_gps_status_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_GPS_STATUS, &vconf_value))
-               vconf_value = VCONFKEY_LOCATION_GPS_OFF;
+       ret = runtime_info_vconf_get_value_int(VCONF_GPS_STATUS, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_LOCATION_GPS_OFF:
@@ -247,7 +251,7 @@ int runtime_info_gps_status_get_value(runtime_info_value_h value)
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_gps_status_set_event_cb()
index 09b6645..11e4ba1 100644 (file)
@@ -37,13 +37,13 @@ static const char *VCONF_LOCATION_NETWORK_ENABLED = VCONFKEY_LOCATION_NETWORK_EN
 int runtime_info_location_service_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value))
-               vconf_value = 0;
+       ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
-       value->b = vconf_value;
-
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_location_service_set_event_cb()
@@ -59,13 +59,13 @@ void runtime_info_location_service_unset_event_cb()
 int runtime_info_location_agps_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_AGPS_ENABLED, &vconf_value))
-               vconf_value = 0;
-
-       value->b = vconf_value;
+       ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_AGPS_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_location_agps_set_event_cb()
@@ -81,13 +81,13 @@ void runtime_info_location_agps_unset_event_cb()
 int runtime_info_location_network_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value))
-               vconf_value = 0;
-
-       value->b = vconf_value;
+       ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_location_network_set_event_cb()
index 90b31fd..2838c2f 100644 (file)
@@ -68,9 +68,11 @@ void runtime_info_flightmode_unset_event_cb(void)
 int runtime_info_audiojack_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK, &vconf_value))
-               vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
+       ret = runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_SYSMAN_EARJACK_3WIRE:
@@ -83,7 +85,7 @@ int runtime_info_audiojack_get_value(runtime_info_value_h value)
                break;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_audiojack_set_event_cb(void)
@@ -138,13 +140,13 @@ void runtime_info_silent_mode_unset_event_cb(void)
 int runtime_info_vibration_enabled_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vconf_value))
-               vconf_value = 0;
-
-       value->b = (bool)vconf_value;
+       ret = runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (bool)vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_vibration_enabled_set_event_cb(void)
@@ -160,13 +162,13 @@ void runtime_info_vibration_enabled_unset_event_cb(void)
 int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value))
-               vconf_value = 0;
-
-       value->b = (bool)vconf_value;
+       ret = runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = (bool)vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_auto_rotation_enabled_set_event_cb(void)
@@ -182,17 +184,13 @@ void runtime_info_auto_rotation_enabled_unset_event_cb(void)
 int runtime_info_battery_charging_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       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;
+       ret = runtime_info_vconf_get_value_int(VCONF_BATTERY_CHARGING, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_battery_charging_set_event_cb(void)
@@ -209,9 +207,11 @@ void runtime_info_battery_charging_unset_event_cb(void)
 int runtime_info_tvout_connected_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value))
-               vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
+       ret = runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_SYSMAN_EARJACK_TVOUT:
@@ -223,7 +223,7 @@ int runtime_info_tvout_connected_get_value(runtime_info_value_h value)
                break;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_tvout_connected_set_event_cb(void)
@@ -240,9 +240,11 @@ void runtime_info_tvout_connected_unset_event_cb(void)
 int runtime_info_audio_jack_status_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK_STATUS, &vconf_value))
-               vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
+       ret = runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK_STATUS, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_SYSMAN_EARJACK_3WIRE:
@@ -258,7 +260,7 @@ int runtime_info_audio_jack_status_get_value(runtime_info_value_h value)
                break;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_audio_jack_status_set_event_cb(void)
@@ -313,9 +315,11 @@ void runtime_info_sliding_keyboard_opened_unset_event_cb(void)
 int runtime_info_usb_connected_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_USB_CONNECTED, &vconf_value))
-               vconf_value = VCONFKEY_SYSMAN_USB_DISCONNECTED;
+       ret = runtime_info_vconf_get_value_int(VCONF_USB_CONNECTED, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_SYSMAN_USB_DISCONNECTED:
@@ -334,7 +338,7 @@ int runtime_info_usb_connected_get_value(runtime_info_value_h value)
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_usb_connected_set_event_cb(void)
@@ -350,14 +354,14 @@ void runtime_info_usb_connected_unset_event_cb(void)
 int runtime_info_charger_connected_get_value(runtime_info_value_h value)
 {
        int vconf_value;
+       int ret;
 
-       if (runtime_info_vconf_get_value_int(VCONF_CHARGER_CONNECTED, &vconf_value))
-               return RUNTIME_INFO_ERROR_IO_ERROR;
+       ret = runtime_info_vconf_get_value_int(VCONF_CHARGER_CONNECTED, &vconf_value);
+       if (ret != RUNTIME_INFO_ERROR_NONE)
+               return ret;
 
        switch (vconf_value) {
        case VCONFKEY_SYSMAN_CHARGER_DISCONNECTED:
-       /* regard not supported as disconnected */
-       case -ENOTSUP:
                value->b = false;
                break;
 
@@ -369,7 +373,7 @@ int runtime_info_charger_connected_get_value(runtime_info_value_h value)
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_charger_connected_set_event_cb(void)
index 4f40980..e9c8e38 100644 (file)
 
 #define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
 
+#define CHECK_VCONF_RESULT(ret) \
+       do { \
+               if (ret < 0) { \
+                       ret = vconf_get_ext_errno(); \
+                       if (ret == VCONF_ERROR_FILE_NO_ENT) \
+                               ret = RUNTIME_INFO_ERROR_NOT_SUPPORTED; \
+                       else \
+                               ret = RUNTIME_INFO_ERROR_IO_ERROR; \
+               } else { \
+                       ret = RUNTIME_INFO_ERROR_NONE; \
+               } \
+       } while (0);
+
 int runtime_info_vconf_get_value_int(const char *vconf_key, int *value)
 {
-       return vconf_get_int(vconf_key, value);
+       int ret = vconf_get_int(vconf_key, value);
+       CHECK_VCONF_RESULT(ret);
+       return ret;
 }
 
 int runtime_info_vconf_get_value_bool(const char *vconf_key, int *value)
 {
-       return vconf_get_bool(vconf_key, value);
+       int ret = vconf_get_bool(vconf_key, value);
+       CHECK_VCONF_RESULT(ret);
+       return ret;
 }
 
 int runtime_info_vconf_get_value_double(const char *vconf_key, double *value)
 {
-       return vconf_get_dbl(vconf_key, value);
+       int ret = vconf_get_dbl(vconf_key, value);
+       CHECK_VCONF_RESULT(ret);
+       return ret;
 }
 
 int runtime_info_vconf_get_value_string(const char *vconf_key, char **value)
 {
        char *str_value = NULL;
+       int ret;
 
        str_value = vconf_get_str(vconf_key);
-
-       if (str_value != NULL) {
-               *value = str_value;
-               return 0;
-       } else {
-               return -1;
+       if (!str_value) {
+               ret = -1;
+               CHECK_VCONF_RESULT(ret);
+               return ret;
        }
+
+       *value = str_value;
+       return RUNTIME_INFO_ERROR_NONE;
 }
 
 typedef void (*runtime_info_vconf_event_cb)(keynode_t *node, void *event_data);
@@ -117,16 +138,16 @@ static runtime_info_vconf_event_cb runtime_info_vconf_get_event_cb_slot(int slot
 int runtime_info_vconf_set_event_cb(const char *vconf_key, runtime_info_key_e runtime_info_key, int slot)
 {
        runtime_info_vconf_event_cb vconf_event_cb;
+       int ret;
 
        vconf_event_cb = runtime_info_vconf_get_event_cb_slot(slot);
 
        if (vconf_event_cb == NULL)
                return RUNTIME_INFO_ERROR_IO_ERROR;
 
-       if (vconf_notify_key_changed(vconf_key, vconf_event_cb, (void *)runtime_info_key))
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-
-       return RUNTIME_INFO_ERROR_NONE;
+       ret = vconf_notify_key_changed(vconf_key, vconf_event_cb, (void *)runtime_info_key);
+       CHECK_VCONF_RESULT(ret);
+       return ret;
 }
 
 void runtime_info_vconf_unset_event_cb(const char *vconf_key, int slot)