LocationAccuracy *acc;
LocationSatellite *sat;
GList *boundary_list;
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
+#if defined(TIZEN_DEVICE)
sensor_h sensor;
sensor_listener_h sensor_listener;
#endif
return ret;
}
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
+#if defined(TIZEN_DEVICE)
static void __sensor_event_cb(sensor_h s, sensor_event_s *event, void *data)
{
LocationGpsPrivate *priv = GET_PRIVATE(data);
}
#endif
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
- return __set_sensor_batch(self, priv->batch_interval);
+#if defined(TIZEN_DEVICE)
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV)
+ return __set_sensor_batch(self, priv->batch_interval);
#endif
}
int ret = LOCATION_ERROR_NONE;
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
- ret = sensor_listener_stop(priv->sensor_listener);
- LOC_IF_FAIL(ret, _E, "Fail to listener_stop [%s]", err_msg(LOCATION_ERROR_NOT_AVAILABLE));
+#if defined(TIZEN_DEVICE)
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ ret = sensor_listener_stop(priv->sensor_listener);
+ LOC_IF_FAIL(ret, _E, "Fail to listener_stop [%s]", err_msg(LOCATION_ERROR_NOT_AVAILABLE));
- ret = sensor_listener_unset_event_cb(priv->sensor_listener);
- LOC_IF_FAIL_LOG(ret, _E, "Fail to listener_unset_event_cb [%s]", err_msg(ret));
+ ret = sensor_listener_unset_event_cb(priv->sensor_listener);
+ LOC_IF_FAIL_LOG(ret, _E, "Fail to listener_unset_event_cb [%s]", err_msg(ret));
- ret = sensor_destroy_listener(priv->sensor_listener);
- LOC_IF_FAIL_LOG(ret, _E, "Fail to destroy_listener [%s]", err_msg(ret));
-#else
- if (__get_started(self) == TRUE) {
- __set_started(self, FALSE);
- ret = priv->mod->ops.stop_batch(priv->mod->handler);
- LOC_IF_FAIL_LOG(ret, _E, "Failed to stop_batch [%s]", err_msg(ret));
+ ret = sensor_destroy_listener(priv->sensor_listener);
+ LOC_IF_FAIL_LOG(ret, _E, "Fail to destroy_listener [%s]", err_msg(ret));
} else {
- return LOCATION_ERROR_NONE;
- }
+#else
+ if (1) {
#endif
+ if (__get_started(self) == TRUE) {
+ __set_started(self, FALSE);
+ ret = priv->mod->ops.stop_batch(priv->mod->handler);
+ LOC_IF_FAIL_LOG(ret, _E, "Failed to stop_batch [%s]", err_msg(ret));
+ } else {
+ return LOCATION_ERROR_NONE;
+ }
+ }
__reset_pos_data_from_priv(priv);
priv->boundary_list = NULL;
priv->loc_timeout = 0;
-#if defined(TIZEN_DEVICE) && !defined(TIZEN_PROFILE_TV)
- priv->sensor = NULL;
- priv->sensor_listener = NULL;
+#if defined(TIZEN_DEVICE)
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ priv->sensor = NULL;
+ priv->sensor_listener = NULL;
+ }
#endif
priv->app_type = location_get_app_type(NULL);
#include "location-position.h"
#include "module-internal.h"
#include "location-common-util.h"
-#ifndef TIZEN_PROFILE_TV
#include "location-privacy.h"
-#endif
#define LOCATION_PRIVILEGE "http://tizen.org/privilege/location"
#define LOCATION_ENABLE_PRIVILEGE "http://tizen.org/privilege/location.enable"
g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_start(LOCATION_IELEMENT(obj));
LOC_IF_FAIL(ret, _E, "Fail to start [%s]", err_msg(ret));
g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_start_batch(LOCATION_IELEMENT(obj));
LOC_IF_FAIL(ret, _E, "Fail to start_batch [%s]", err_msg(ret));
int ret = 0;
char *_key = NULL;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
+ LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
+ }
if (location_setting_get_int(VCONFKEY_LOCATION_RESTRICT) > RESTRICT_OFF) {
LOCATION_SECLOG("Location setting is denied by DPM");
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_position(LOCATION_IELEMENT(obj), position, accuracy);
LOC_COND_RET(ret != LOCATION_ERROR_NONE, ret, _E, "Fail to get_position [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_position_ext(LOCATION_IELEMENT(obj), position, velocity, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to get_position_ext [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_last_position(LOCATION_IELEMENT(obj), position, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to get_last_position [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_last_position_ext(LOCATION_IELEMENT(obj), position, velocity, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to get_last_position_ext [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_satellite(LOCATION_IELEMENT(obj), satellite);
LOC_IF_FAIL(ret, _E, "Fail to get_satellite [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_batch(LOCATION_IELEMENT(obj), batch);
LOC_IF_FAIL(ret, _E, "Fail to get_batch [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_last_satellite(LOCATION_IELEMENT(obj), satellite);
LOC_IF_FAIL(ret, _E, "Fail to get_last_satellite [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_velocity(LOCATION_IELEMENT(obj), velocity, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_get_last_velocity(LOCATION_IELEMENT(obj), velocity, accuracy);
LOC_IF_FAIL(ret, _E, "Fail to get_last_velocity [%s]", err_msg(ret));
EXPORT_API int
location_get_accessibility_state(LocationAccessState *state)
{
-#ifndef TIZEN_PROFILE_TV
- int ret = location_check_cynara(LOCATION_PRIVILEGE);
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ int ret = location_check_cynara(LOCATION_PRIVILEGE);
- if (ret == LOCATION_ERROR_NONE) {
- *state = LOCATION_ACCESS_ALLOWED;
+ if (ret == LOCATION_ERROR_NONE) {
+ *state = LOCATION_ACCESS_ALLOWED;
+ } else {
+ *state = LOCATION_ACCESS_DENIED;
+ LOCATION_LOGE("Cannot use location service for privacy[%d]", ret);
+ }
} else {
- *state = LOCATION_ACCESS_DENIED;
- LOCATION_LOGE("Cannot use location service for privacy[%d]", ret);
+ *state = LOCATION_ACCESS_ALLOWED;
}
-#else
- *state = LOCATION_ACCESS_ALLOWED;
-#endif
return LOCATION_ERROR_NONE;
}
g_return_val_if_fail(obj, LOCATION_ERROR_PARAMETER);
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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_option(LOCATION_IELEMENT(obj), option);
LOC_IF_FAIL(ret, _E, "Fail to get_velocity [%s]", err_msg(ret));
{
int ret = LOCATION_ERROR_NONE;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ 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));
+ }
#if 0 /* Tizen platform didn't turn developer option on */
gboolean developer_option = FALSE;
int ret = LOCATION_ERROR_NONE;
int restriction = 0;
-#ifndef TIZEN_PROFILE_TV
- ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
- LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
-#endif
+ if (_get_tizen_profile() != TIZEN_PROFILE_TV) {
+ ret = location_check_cynara(LOCATION_ENABLE_PRIVILEGE);
+ LOC_IF_FAIL(ret, _E, "Privilege not allowed [%s]", err_msg(ret));
+ }
if (enable) {
int value = 0;
ret = vconf_get_int(VCONFKEY_LOCATION_RESTRICT, &restriction);