tizen 2.3.1 release
[framework/api/runtime-info.git] / src / runtime_info_location.c
old mode 100755 (executable)
new mode 100644 (file)
index 458928f..11e4ba1
@@ -11,7 +11,7 @@
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
- * limitations under the License. 
+ * limitations under the License.
  */
 
 #include <stdio.h>
 #undef LOG_TAG
 #endif
 
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
 
-static const char *VCONF_LOCATION_SERVICE_ENABLED = "db/location/setting/GpsEnabled";
-static const char *VCONF_LOCATION_AGPS_ENABLED = "db/location/setting/AgpsEnabled";
-static const char *VCONF_LOCATION_NETWORK_ENABLED = "db/location/setting/NetworkEnabled";
-static const char *VCONF_LOCATION_SENSOR_ENABLED = "db/location/setting/SensorEnabled";
+static const char *VCONF_LOCATION_SERVICE_ENABLED = VCONFKEY_LOCATION_ENABLED;
+static const char *VCONF_LOCATION_AGPS_ENABLED = VCONFKEY_LOCATION_AGPS_ENABLED;
+static const char *VCONF_LOCATION_NETWORK_ENABLED = VCONFKEY_LOCATION_NETWORK_ENABLED;
 
 int runtime_info_location_service_get_value(runtime_info_value_h value)
 {
        int vconf_value;
-       
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value))
-       {
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-       }
+       int ret;
 
-       value->b = vconf_value;
+       ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value);
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
-       return RUNTIME_INFO_ERROR_NONE;
+       return ret;
 }
 
 int runtime_info_location_service_set_event_cb()
@@ -62,15 +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;
-       
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_AGPS_ENABLED, &vconf_value))
-       {
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-       }
+       int ret;
 
-       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()
@@ -86,15 +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;
-       
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value))
-       {
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-       }
+       int ret;
 
-       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()
@@ -106,28 +99,3 @@ void runtime_info_location_network_unset_event_cb()
 {
        runtime_info_vconf_unset_event_cb(VCONF_LOCATION_NETWORK_ENABLED, 0);
 }
-
-int runtime_info_location_sensor_get_value(runtime_info_value_h value)
-{
-       int vconf_value;
-       
-       if (runtime_info_vconf_get_value_int(VCONF_LOCATION_SENSOR_ENABLED, &vconf_value))
-       {
-               return RUNTIME_INFO_ERROR_IO_ERROR;
-       }
-
-       value->b = vconf_value;
-
-       return RUNTIME_INFO_ERROR_NONE;
-}
-
-int runtime_info_location_sensor_set_event_cb()
-{
-       return runtime_info_vconf_set_event_cb(VCONF_LOCATION_SENSOR_ENABLED, RUNTIME_INFO_KEY_LOCATION_SENSOR_AIDING_ENABLED, 0);
-}
-
-void runtime_info_location_sensor_unset_event_cb()
-{
-       runtime_info_vconf_unset_event_cb(VCONF_LOCATION_SENSOR_ENABLED, 0);
-}
-