#ifndef __TIZEN_SYSTEM_RUNTIME_INFO_PRIVATE_H__
#define __TIZEN_SYSTEM_RUNTIME_INFO_PRIVATE_H__
+#include <system_info.h>
#include <vconf.h>
#ifdef __cplusplus
#define RUNTIME_INFO_INTERNAL_KEY_WIFI_STATUS 1
+#define RETURN_ERROR_IF_NOT_SUPPORTED(feature) \
+{ \
+ bool _supported; \
+ if (system_info_get_platform_bool(feature, &_supported) != SYSTEM_INFO_ERROR_NONE) \
+ return RUNTIME_INFO_ERROR_IO_ERROR; \
+ if (!_supported) \
+ return RUNTIME_INFO_ERROR_NOT_SUPPORTED; \
+}
+
typedef enum {
RUNTIME_INFO_DATA_TYPE_STRING,
RUNTIME_INFO_DATA_TYPE_INT,
#include <runtime_info.h>
#include <runtime_info_private.h>
-#include <system_info.h>
-
#ifdef LOG_TAG
#undef LOG_TAG
#endif
{
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)
{
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)
{
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)
#include <runtime_info.h>
#include <runtime_info_private.h>
-#include <system_info.h>
-
#ifdef LOG_TAG
#undef LOG_TAG
#endif
{
int vconf_value;
int ret;
- bool supported;
LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED is deprecated and will be removed from next release.");
- ret = system_info_get_platform_bool("http://tizen.org/feature/location.wps", &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/location.wps");
ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value);
if (ret == RUNTIME_INFO_ERROR_NONE)