Check support if we can 79/178779/1
authorKichan Kwon <k_c.kwon@samsung.com>
Mon, 14 May 2018 04:43:15 +0000 (13:43 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 14 May 2018 04:45:30 +0000 (13:45 +0900)
- Wi-Fi, Bluetooth, GPS, location, auto rotation and battery

Change-Id: Id3fe52bb59bfc058128790f73dab793eeb50eed4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/runtime_info_connectivity.c
src/runtime_info_location.c
src/runtime_info_system.c

index a9c1f84..3961db6 100644 (file)
@@ -44,6 +44,8 @@ int runtime_info_wifi_status_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.wifi");
+
        ret = runtime_info_vconf_get_value_int(VCONF_WIFI_STATUS, &vconf_value);
        if (ret != RUNTIME_INFO_ERROR_NONE)
                return ret;
@@ -84,6 +86,8 @@ int runtime_info_bt_enabled_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.bluetooth");
+
        ret = runtime_info_vconf_get_value_int(VCONF_BT_ENABLED, &vconf_value);
        if (ret != RUNTIME_INFO_ERROR_NONE)
                return ret;
@@ -238,6 +242,8 @@ int runtime_info_gps_status_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/location.gps");
+
        ret = runtime_info_vconf_get_value_int(VCONF_GPS_STATUS, &vconf_value);
        if (ret != RUNTIME_INFO_ERROR_NONE)
                return ret;
index a74b006..3acddf7 100644 (file)
@@ -41,6 +41,8 @@ int runtime_info_location_service_get_value(runtime_info_value_h value)
 
        LOGW("DEPRECATION WARNING: RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED is deprecated and will be removed from next release.");
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/location");
+
        ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)
                value->b = vconf_value;
index 74f0ffe..cd9d678 100644 (file)
@@ -94,6 +94,8 @@ int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/screen.auto_rotation");
+
        ret = runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)
                value->b = (bool)vconf_value;
@@ -116,6 +118,8 @@ int runtime_info_battery_charging_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/battery");
+
        ret = runtime_info_vconf_get_value_int(VCONF_BATTERY_CHARGING, &vconf_value);
        if (ret == RUNTIME_INFO_ERROR_NONE)
                value->b = vconf_value;
@@ -237,6 +241,8 @@ int runtime_info_charger_connected_get_value(runtime_info_value_h value)
        int vconf_value;
        int ret;
 
+       RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/battery");
+
        ret = runtime_info_vconf_get_value_int(VCONF_CHARGER_CONNECTED, &vconf_value);
        if (ret != RUNTIME_INFO_ERROR_NONE)
                return ret;