LocationPosition *pos = location_position_new(0, 0.0, 0.0, 0.0, LOCATION_STATUS_NO_FIX);
LocationVelocity *vel = location_velocity_new(0, 0.0, 0.0, 0.0);
- LocationAccuracy *acc = location_accuracy_new(LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
if (priv->loc_timeout) g_source_remove(priv->loc_timeout);
priv->loc_timeout = 0;
- g_signal_emit(self, signals[LOCATION_UPDATED], 0, LOCATION_ERROR_NOT_AVAILABLE, pos, vel, acc);
+ g_signal_emit(self, signals[LOCATION_UPDATED], 0, LOCATION_ERROR_NOT_AVAILABLE, pos, vel, NULL);
location_gps_stop(self);
return FALSE;
if (__get_started(self) == TRUE) return LOCATION_ERROR_NONE;
int ret = LOCATION_ERROR_NONE;
-
- __set_started(self, TRUE);
- ret = priv->mod->ops.start(priv->mod->handler, LOCATION_UPDATE_INTERVAL_DEFAULT, gps_status_cb, gps_single_location_cb, NULL, self);
- if (ret != LOCATION_ERROR_NONE) {
- LOCATION_LOGE("Fail to start request single. Error[%d]", ret);
- __set_started(self, FALSE);
- return ret;
+ if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED)) {
+ ret = LOCATION_ERROR_SETTING_OFF;
} else {
- if (priv->loc_timeout != 0)
- g_source_remove(priv->loc_timeout);
+ __set_started(self, TRUE);
+ ret = priv->mod->ops.start(priv->mod->handler, LOCATION_UPDATE_INTERVAL_DEFAULT, gps_status_cb, gps_single_location_cb, NULL, self);
+ if (ret != LOCATION_ERROR_NONE) {
+ LOCATION_LOGE("Fail to start request single. Error[%d]", ret);
+ __set_started(self, FALSE);
+ return ret;
+ } else {
+ if (priv->loc_timeout != 0)
+ g_source_remove(priv->loc_timeout);
- priv->loc_timeout = g_timeout_add_seconds(timeout, __single_location_timeout_cb, self);
- }
+ priv->loc_timeout = g_timeout_add_seconds(timeout, __single_location_timeout_cb, self);
+ }
+ }
return ret;
}
LocationPosition *pos = location_position_new(0, 0.0, 0.0, 0.0, LOCATION_STATUS_NO_FIX);
LocationVelocity *vel = location_velocity_new(0, 0.0, 0.0, 0.0);
- LocationAccuracy *acc = location_accuracy_new(LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
if (priv->loc_timeout) g_source_remove(priv->loc_timeout);
priv->loc_timeout = 0;
- g_signal_emit(self, signals[LOCATION_UPDATED], 0, LOCATION_ERROR_NOT_AVAILABLE, pos, vel, acc);
+ g_signal_emit(self, signals[LOCATION_UPDATED], 0, LOCATION_ERROR_NOT_AVAILABLE, pos, vel, NULL);
location_wps_stop(self);
return FALSE;
int ret = LOCATION_ERROR_NONE;
- __set_started(self, TRUE);
- ret = priv->mod->ops.start(priv->mod->handler, wps_status_cb, wps_single_location_cb, self);
- if (ret != LOCATION_ERROR_NONE) {
- LOCATION_LOGE("Fail to start request single. Error[%d]", ret);
- __set_started(self, FALSE);
- return ret;
+ if (!location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED)) {
+ ret = LOCATION_ERROR_SETTING_OFF;
} else {
- if (priv->loc_timeout != 0)
- g_source_remove(priv->loc_timeout);
+ __set_started(self, TRUE);
+ ret = priv->mod->ops.start(priv->mod->handler, wps_status_cb, wps_single_location_cb, self);
+ if (ret != LOCATION_ERROR_NONE) {
+ LOCATION_LOGE("Fail to start request single. Error[%d]", ret);
+ __set_started(self, FALSE);
+ return ret;
+ } else {
+ if (priv->loc_timeout != 0)
+ g_source_remove(priv->loc_timeout);
+
+ priv->loc_timeout = g_timeout_add_seconds(timeout, __single_location_timeout_cb, self);
+ }
- priv->loc_timeout = g_timeout_add_seconds(timeout, __single_location_timeout_cb, self);
}
return ret;
{
LOC_FUNC_LOG
LocationWpsPrivate *priv = GET_PRIVATE(self);
+ g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
+ g_return_val_if_fail(priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail(priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail(priv->mod->ops.set_mock_location, LOCATION_ERROR_NOT_AVAILABLE);
{
LOC_FUNC_LOG
LocationWpsPrivate *priv = GET_PRIVATE(self);
+ g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
+ g_return_val_if_fail(priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail(priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail(priv->mod->ops.clear_mock_location, LOCATION_ERROR_NOT_AVAILABLE);
void *user_data;
} LocationSetting;
-enum {
- _METHOD_HYBRID = 0,
- _METHOD_GPS_1,
- _METHOD_GPS_2,
- _METHOD_WPS_1,
- _METHOD_WPS_2,
- _METHOD_MAX
-};
-
static LocationSetting g_location_setting;
-static bool is_method_created[_METHOD_MAX] = {false};
static char *__convert_setting_key(LocationMethod method)
{
}
EXPORT_API LocationObject *
-location_new(LocationMethod method, gboolean is_internal_for_hybrid)
+location_new(LocationMethod method, gboolean multi_handle)
{
LocationObject *self = NULL;
- LOCATION_LOGD("method : %d, is_internal_for_hybrid[%d]", method, is_internal_for_hybrid);
+ LOCATION_LOGD("method : %d, multi_handle[%d]", method, multi_handle);
switch (method) {
case LOCATION_METHOD_HYBRID:
- if (is_method_created[_METHOD_HYBRID]) {
- LOCATION_LOGE("Hybrid handle already exist.");
- } else {
- self = g_object_new(LOCATION_TYPE_HYBRID, NULL);
- is_method_created[_METHOD_HYBRID] = true;
- }
+ self = g_object_new(LOCATION_TYPE_HYBRID, NULL);
break;
case LOCATION_METHOD_GPS:
- if (is_internal_for_hybrid) {
- if (is_method_created[_METHOD_GPS_2]) {
- LOCATION_LOGD("Hybrid(GPS) handle already exist.");
- } else {
- is_method_created[_METHOD_GPS_2] = true;
- self = g_object_new(LOCATION_TYPE_GPS, NULL);
- }
- } else {
- if (is_method_created[_METHOD_GPS_1]) {
- LOCATION_LOGE("GPS handle already exist.");
- } else {
- is_method_created[_METHOD_GPS_1] = true;
- self = g_object_new(LOCATION_TYPE_GPS, NULL);
- }
- }
+ self = g_object_new(LOCATION_TYPE_GPS, NULL);
break;
case LOCATION_METHOD_WPS:
- if (is_internal_for_hybrid) {
- if (is_method_created[_METHOD_WPS_2]) {
- LOCATION_LOGD("Hybrid(WPS) handle already exist.");
- } else {
- is_method_created[_METHOD_WPS_2] = true;
- self = g_object_new(LOCATION_TYPE_WPS, NULL);
- }
- } else {
- if (is_method_created[_METHOD_WPS_1]) {
- LOCATION_LOGE("WPS handle already exist.");
- } else {
- is_method_created[_METHOD_WPS_1] = true;
- self = g_object_new(LOCATION_TYPE_WPS, NULL);
- }
- }
+ self = g_object_new(LOCATION_TYPE_WPS, NULL);
break;
case LOCATION_METHOD_PASSIVE:
self = g_object_new(LOCATION_TYPE_PASSIVE, NULL);
}
EXPORT_API int
-location_free(LocationObject *obj, gboolean is_internal_for_hybrid)
+location_free(LocationObject *obj, gboolean multi_handle)
{
g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
- if (G_OBJECT_TYPE(obj) == LOCATION_TYPE_HYBRID) {
- is_method_created[_METHOD_HYBRID] = false;
- } else if (G_OBJECT_TYPE(obj) == LOCATION_TYPE_GPS) {
- if (is_internal_for_hybrid)
- is_method_created[_METHOD_GPS_2] = false;
- else
- is_method_created[_METHOD_GPS_1] = false;
- } else if (G_OBJECT_TYPE(obj) == LOCATION_TYPE_WPS) {
- if (is_internal_for_hybrid)
- is_method_created[_METHOD_WPS_2] = false;
- else
- is_method_created[_METHOD_WPS_1] = false;
- }
g_object_unref(obj);
return LOCATION_ERROR_NONE;
}
g_return_val_if_fail(accuracy, LOCATION_ERROR_PARAMETER);
int ret = LOCATION_ERROR_NONE;
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ ret = location_check_cynara(LOCATION_PRIVILEGE);
+ LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
+ }
+
ret = location_ielement_set_mock_location(LOCATION_IELEMENT(obj), position, velocity, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to set_mock_location [%s]", err_msg(ret));
g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
int ret = LOCATION_ERROR_NONE;
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ ret = location_check_cynara(LOCATION_PRIVILEGE);
+ LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
+ }
+
ret = location_ielement_clear_mock_location(LOCATION_IELEMENT(obj));
LOC_IF_FAIL(ret, _E, "Fail to clear_mock_location [%s]", err_msg(ret));
* @retval NULL if error occured
* @see location_free
*/
-LocationObject *location_new(LocationMethod method, gboolean is_internal_for_hybrid);
+LocationObject *location_new(LocationMethod method, gboolean multi_handle);
/**
* @brief Free memory of given #LocationObject.
* @retval 0 Success.
* Please refer #LocationError for more information.
*/
-int location_free(LocationObject *obj, gboolean is_internal_for_hybrid);
+int location_free(LocationObject *obj, gboolean multi_handle);
/**
* @brief Start the location service by using given #LocationObject.
+[Version] libslp-location_1.3.11
+[Date] 29 Mar 2017
+[Changes] Fix dynamic interval to support multi handle
+[Developer] Kyoungjun Sung <kj7.sung@samsung.com>
+
+================================================================================
+[Version] libslp-location_1.3.10
+[Date] 8 Mar 2017
+[Changes] Privilege check for mock location
+[Developer] Kyoungjun Sung <kj7.sung@samsung.com>
+
+================================================================================
[Version] libslp-location_1.3.9
[Date] 7 Mar 2017
[Changes] Fix build error for tv profile
Name: liblbs-location
Summary: Location Based Service Library
-Version: 1.3.9
+Version: 1.3.11
Release: 1
Group: Location/Libraries
License: Apache-2.0