From a29ead40b64c47eccf7093b5badf6192d6b4f32e Mon Sep 17 00:00:00 2001 From: Young-Ae Kang Date: Thu, 8 Oct 2015 15:11:04 +0900 Subject: [PATCH] Sync with version 0.11.6 in tizen 2.4. Change-Id: Ibf14eb897f0243a4f484a71936ca1f0a4837c134 --- CMakeLists.txt | 3 +-- location/manager/location-boundary.c | 4 +--- location/manager/location-gps.c | 4 ++-- location/manager/location-hybrid-mobile.c | 36 +++++++++++++++++++++++++------ 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0860703..1123dca 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,7 @@ ELSE(FEATURE_PROFILE_TV) MESSAGE("<<< Wearable Profile >>>") ELSE(FEATURE_PROFILE_WEARABLE) MESSAGE("<<< Mobile Profile >>>") - #This is for OSP deamon. We don't need it any more. - #ADD_DEFINITIONS("-DTIZEN_PROFILE_MOBILE") + ADD_DEFINITIONS("-DTIZEN_PROFILE_MOBILE") ENDIF(FEATURE_PROFILE_WEARABLE) ENDIF(FEATURE_PROFILE_TV) diff --git a/location/manager/location-boundary.c b/location/manager/location-boundary.c index 6a94ea9..7e5a487 100644 --- a/location/manager/location-boundary.c +++ b/location/manager/location-boundary.c @@ -237,7 +237,7 @@ location_boundary_if_inside(LocationBoundary *boundary, case LOCATION_BOUNDARY_POLYGON: { double interval_x = 0.0, interval_y = 0.0; - double x0=0.0, y0=0.0; + double x0 = 0.0, y0 = 0.0; gboolean edge_area; int crossing_num = 0; GList *position_list = boundary->polygon.position_list; @@ -259,8 +259,6 @@ location_boundary_if_inside(LocationBoundary *boundary, * Case 2. longitude2 - longitude1 < -180 : interval_y = longitude2 - longitude1 + 360 * Case 3. longitude2 - longitude1 > 180 : intreval_y = longitude2 - longitude1 - 360 */ - - LOCATION_LOGD("edge_area = %d, interval_y = %lf, interval_x = %lf", edge_area,interval_y, interval_x); if (interval_y > 180) { interval_y = interval_y - 360; edge_area = TRUE; diff --git a/location/manager/location-gps.c b/location/manager/location-gps.c index 6f04bec..d83d126 100755 --- a/location/manager/location-gps.c +++ b/location/manager/location-gps.c @@ -155,7 +155,7 @@ _position_timeout_cb(gpointer data) } else { priv->signal_type |= POSITION_UPDATED; } - _location_timeout_cb(priv); + _location_timeout_cb(object); return TRUE; } @@ -169,7 +169,7 @@ _velocity_timeout_cb(gpointer data) if (priv->pos_interval != priv->vel_interval) { priv->signal_type |= VELOCITY_UPDATED; - _location_timeout_cb(priv); + _location_timeout_cb(object); } return TRUE; diff --git a/location/manager/location-hybrid-mobile.c b/location/manager/location-hybrid-mobile.c index 8e62ef0..4026784 100644 --- a/location/manager/location-hybrid-mobile.c +++ b/location/manager/location-hybrid-mobile.c @@ -224,7 +224,7 @@ _position_timeout_cb(gpointer data) } else { priv->signal_type |= POSITION_UPDATED; } - _location_timeout_cb(priv); + _location_timeout_cb(object); return TRUE; } @@ -238,7 +238,7 @@ _velocity_timeout_cb(gpointer data) if (priv->pos_interval != priv->vel_interval) { priv->signal_type |= VELOCITY_UPDATED; - _location_timeout_cb(priv); + _location_timeout_cb(object); } return TRUE; @@ -328,17 +328,19 @@ hybrid_service_updated(GObject *obj, LocationHybridPrivate *priv = GET_PRIVATE((LocationHybrid *)self); g_return_if_fail(priv); + GType g_type = G_TYPE_FROM_INSTANCE(obj); if (g_type == LOCATION_TYPE_GPS) { if (type == SATELLITE_UPDATED) { satellite_signaling(self, signals, &(priv->enabled), priv->sat_interval, TRUE, &(priv->sat_updated_timestamp), &(priv->sat), sat); - return ; + return; } else if (location_setting_get_int(VCONFKEY_LOCATION_GPS_STATE) == VCONFKEY_LOCATION_GPS_SEARCHING) { LOCATION_LOGD("Searching GPS"); /* restart WPS when GPS not available */ if (priv->wps) g_object_get(priv->wps, "is_started", &wps_started, NULL); if (priv->wps && wps_started == FALSE) { + LOCATION_LOGD("Starting WPS"); ret = location_start(priv->wps); if (ret != LOCATION_ERROR_NONE) { LOCATION_LOGW("Fail hyhrid location_start : [%d]", ret); @@ -351,6 +353,8 @@ hybrid_service_updated(GObject *obj, } else if (g_type == LOCATION_TYPE_WPS && location_setting_get_int(VCONFKEY_LOCATION_WPS_STATE) == VCONFKEY_LOCATION_WPS_SEARCHING) { LOCATION_LOGD("Searching WPS"); return; + } else if (g_type == LOCATION_TYPE_WPS) { + LOCATION_LOGD("g_type is LOCATION_TYPE_WPS"); } if (hybrid_compare_g_type_method(priv, g_type)) { @@ -386,10 +390,30 @@ hybrid_service_updated(GObject *obj, return; } } + } else if (g_type == LOCATION_TYPE_WPS && location_setting_get_int(VCONFKEY_LOCATION_GPS_STATE) == VCONFKEY_LOCATION_GPS_SEARCHING) { + hybrid_set_current_method(priv, g_type); + + if (priv->pos) location_position_free(priv->pos); + if (priv->vel) location_velocity_free(priv->vel); + if (priv->acc) location_accuracy_free(priv->acc); - } else if (type == POSITION_UPDATED && priv->pos) { - if (pos->timestamp - priv->pos->timestamp > HYBRID_POSITION_EXPIRATION_TIME) { - hybrid_set_current_method(priv, g_type); + if (pos) priv->pos = location_position_copy(pos); + if (vel) priv->vel = location_velocity_copy(vel); + if (acc) priv->acc = location_accuracy_copy(acc); + + if (!priv->enabled && pos) { + enable_signaling(self, signals, &(priv->enabled), TRUE, pos->status); + } + + if (type == DISTANCE_UPDATED) { + distance_based_position_signaling(self, signals, priv->enabled, pos, vel, acc, + priv->min_interval, priv->min_distance, &(priv->enabled), + &(priv->dist_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc)); + } else { + LOCATION_LOGD("position_velocity_signaling"); + position_velocity_signaling(self, signals, priv->pos_interval, priv->vel_interval, priv->loc_interval, + &(priv->pos_updated_timestamp), &(priv->vel_updated_timestamp), &(priv->loc_updated_timestamp), + priv->boundary_list, pos, vel, acc); } } } -- 2.7.4