Define a macro checking feature support
[platform/core/api/runtime-info.git] / src / runtime_info_connectivity.c
index a268629..a9c1f84 100644 (file)
@@ -24,8 +24,6 @@
 #include <runtime_info.h>
 #include <runtime_info_private.h>
 
-#include <system_info.h>
-
 #ifdef LOG_TAG
 #undef LOG_TAG
 #endif
@@ -123,14 +121,8 @@ int runtime_info_wifi_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
        int ret;
-       bool supported;
-
-       ret = system_info_get_platform_bool("http://tizen.org/feature/network.tethering.wifi", &supported);
-       if (ret != SYSTEM_INFO_ERROR_NONE)
-               return RUNTIME_INFO_ERROR_IO_ERROR;
 
-       if (!supported)
-               return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.tethering.wifi");
 
        ret = runtime_info_vconf_get_value_int(VCONF_WIFI_HOTSPOT_ENABLED, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)
@@ -153,14 +145,8 @@ int runtime_info_bt_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
        int ret;
-       bool supported;
 
-       ret = system_info_get_platform_bool("http://tizen.org/feature/network.tethering.bluetooth", &supported);
-       if (ret != SYSTEM_INFO_ERROR_NONE)
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-
-       if (!supported)
-               return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.tethering.bluetooth");
 
        ret = runtime_info_vconf_get_value_int(VCONF_BT_HOTSPOT_ENABLED, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)
@@ -183,14 +169,8 @@ int runtime_info_usb_hotspot_get_value(runtime_info_value_h value)
 {
        int vconf_value;
        int ret;
-       bool supported;
-
-       ret = system_info_get_platform_bool("http://tizen.org/feature/network.tethering.usb", &supported);
-       if (ret != SYSTEM_INFO_ERROR_NONE)
-               return RUNTIME_INFO_ERROR_IO_ERROR;
 
-       if (!supported)
-               return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.tethering.usb");
 
        ret = runtime_info_vconf_get_value_int(VCONF_USB_HOTSPOT_ENABLED, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)