sync : location 31/152431/1 accepted/tizen/unified/20170928.072408 submit/tizen/20170927.014732
authorkj7.sung <kj7.sung@samsung.com>
Tue, 26 Sep 2017 06:42:26 +0000 (15:42 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Tue, 26 Sep 2017 06:42:26 +0000 (15:42 +0900)
Change-Id: I9e92172cffb1ae33f5e8d118ae458608332631ff
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
13 files changed:
CMakeLists.txt
location/CMakeLists.txt
location/include/location-types.h
location/manager/location-batch.c
location/manager/location-batch.h
location/manager/location-fused.c
location/manager/location-gps.c
location/manager/location-hybrid.c [moved from location/manager/location-hybrid-mobile.c with 100% similarity]
location/manager/location-hybrid.h
location/manager/location-passive.c
location/manager/location-setting.c
location/module/location-module.h
packaging/liblbs-location.spec

index 469a8ad..77b4ee0 100755 (executable)
@@ -10,7 +10,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 INCLUDE(FindPkgConfig)
 
 pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 gobject-2.0 gmodule-2.0 capi-appfw-app-manager
-               dlog vconf json-glib-1.0 bundle eventsystem libtzplatform-config capi-system-sensor cynara-client cynara-session)
+               dlog vconf json-glib-1.0 bundle libtzplatform-config capi-system-sensor cynara-client cynara-session)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 550d2df..0ef1007 100644 (file)
@@ -30,6 +30,7 @@ SET(SRCS
        ${MANAGER_DIR}/location-common-util.c
        ${MANAGER_DIR}/location-gps.c
        ${MANAGER_DIR}/location-wps.c
+       ${MANAGER_DIR}/location-hybrid.c
        ${MANAGER_DIR}/location-passive.c
        ${MANAGER_DIR}/location-fused.c
        ${MANAGER_DIR}/location-privacy.c
@@ -37,10 +38,6 @@ SET(SRCS
        ${MODULE_DIR}/module-internal.c
 )
 
-SET(SRCS_MOBILE
-       ${MANAGER_DIR}/location-hybrid-mobile.c
-)
-
 SET (INSTALL_HEADERS
        ${INC_DIR}/location-types.h
 
@@ -56,7 +53,7 @@ SET (INSTALL_HEADERS
        ${MODULE_DIR}/location-module.h
 )
 
-ADD_LIBRARY(${LIB_NAME} SHARED ${SRCS} ${SRCS_MOBILE})
+ADD_LIBRARY(${LIB_NAME} SHARED ${SRCS})
 TARGET_LINK_LIBRARIES(${LIB_NAME} ${pkgs_LDFLAGS} -lm)
 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1)
 
index 38100bf..13d874b 100644 (file)
@@ -39,17 +39,17 @@ G_BEGIN_DECLS
  * @brief This represents the returned error code of used functions.
  */
 typedef enum {
-       LOCATION_ERROR_NONE = 0,                /*/< Success. */
-       LOCATION_ERROR_NOT_ALLOWED,             /*/< Location servie is not allowed from privacy settings. */
+       LOCATION_ERROR_NONE = 0,                        /*/< Success. */
+       LOCATION_ERROR_NOT_ALLOWED,                     /*/< Location servie is not allowed from privacy settings. */
        LOCATION_ERROR_NOT_AVAILABLE,           /*/< Location service is not available. */
        LOCATION_ERROR_NETWORK_FAILED,          /*/< Network is not available. */
        LOCATION_ERROR_NETWORK_NOT_CONNECTED,   /*/< Network is not connected. */
        LOCATION_ERROR_CONFIGURATION,           /*/< Configuration setting is not correct. */
-       LOCATION_ERROR_PARAMETER,               /*/< Input parameter is not correct. */
-       LOCATION_ERROR_NOT_FOUND,               /*/< Output is not found. */
+       LOCATION_ERROR_PARAMETER,                       /*/< Input parameter is not correct. */
+       LOCATION_ERROR_NOT_FOUND,                       /*/< Output is not found. */
        LOCATION_ERROR_NOT_SUPPORTED,           /*/< Not supported. */
-       LOCATION_ERROR_UNKNOWN,                 /*/< Unknown error. */
-       LOCATION_ERROR_SETTING_OFF,             /*/< Location service(GPS/WPS) is off in location settings. */
+       LOCATION_ERROR_UNKNOWN,                         /*/< Unknown error. */
+       LOCATION_ERROR_SETTING_OFF,                     /*/< Location service(GPS/WPS) is off in location settings. */
        LOCATION_ERROR_SECURITY_DENIED,         /*/< System disables location service. */
 } LocationError;
 
index d4acd47..cfd532f 100644 (file)
@@ -43,88 +43,6 @@ location_batch_new(int num_of_location)
        return batch;
 }
 
-EXPORT_API gboolean
-location_set_batch_parse_details(LocationBatch *batch, char *location_info, int i)
-{
-       g_return_val_if_fail(batch, FALSE);
-       g_return_val_if_fail(batch->batch_data, FALSE);
-
-       char location[128] = {0,};
-       char *last_location[MAX_BATCH_ITEM] = {0,};
-       char *last = NULL;
-       int index = 0;
-
-       snprintf(location, sizeof(location), "%s", location_info);
-
-       last_location[index] = (char *)strtok_r(location, ";", &last);
-       while (last_location[index] != NULL) {
-               switch (index) {
-               case 0:
-                               batch->batch_data[i].timestamp = strtod(last_location[index], NULL);
-                               break;
-               case 1:
-                               batch->batch_data[i].latitude = strtod(last_location[index], NULL);
-                               break;
-               case 2:
-                               batch->batch_data[i].longitude = strtod(last_location[index], NULL);
-                               break;
-               case 3:
-                               batch->batch_data[i].altitude = strtod(last_location[index], NULL);
-                               break;
-               case 4:
-                               batch->batch_data[i].speed = strtod(last_location[index], NULL);
-                               break;
-               case 5:
-                               batch->batch_data[i].direction = strtod(last_location[index], NULL);
-                               break;
-               case 6:
-                               batch->batch_data[i].horizontal_accuracy = strtod(last_location[index], NULL);
-                               break;
-               case 7:
-                               batch->batch_data[i].vertical_accuracy = strtod(last_location[index], NULL);
-                               break;
-               default:
-                               break;
-               }
-               if (++index == MAX_BATCH_ITEM) break;
-               last_location[index] = (char *)strtok_r(NULL, ";", &last);
-       }
-
-       return TRUE;
-}
-
-EXPORT_API LocationBatch *
-location_get_batch_file(int num_of_location)
-{
-       LOCATION_LOGD("location_get_batch_file [num_of_location = %d]", num_of_location);
-       LocationBatch *batch = location_batch_new(num_of_location);
-       batch->num_of_location = num_of_location;
-
-       const char *batch_path = tzplatform_mkpath(TZ_SYS_MEDIA, "lbs-server/location_batch.log");
-       FILE *fd = fopen(batch_path, "r");
-
-       if (fd != NULL) {
-               char buf[BATCH_SENTENCE_SIZE] = { 0, };
-               int i = 0;
-
-               for (i = 0; i < num_of_location; i++) {
-                       if (fgets(buf, BATCH_SENTENCE_SIZE, fd) != NULL)
-                               location_set_batch_parse_details(batch, buf, i);
-                       else
-                               LOCATION_LOGE("Batch fgets failed");
-               }
-
-               if (fd != 0) {
-                       if (fclose(fd) != 0)
-                               LOCATION_LOGE("Batch fclose failed");
-                       fd = NULL;
-               }
-       } else {
-               LOCATION_LOGE("Batch fopen failed. fd is NULL");
-       }
-       return batch;
-}
-
 #if defined(TIZEN_DEVICE)
 EXPORT_API gboolean location_set_sensor_batch(LocationBatch *batch, sensor_event_s *event)
 {
@@ -160,28 +78,18 @@ location_batch_copy(const LocationBatch *batch)
        int i = 0;
        for (i = 0 ; i < batch_dup->num_of_location; i++)
                location_set_batch_details(batch_dup, i,
-                                                                       batch->batch_data[i].latitude,
-                                                                       batch->batch_data[i].longitude,
-                                                                       batch->batch_data[i].altitude,
-                                                                       batch->batch_data[i].speed,
-                                                                       batch->batch_data[i].direction,
-                                                                       batch->batch_data[i].horizontal_accuracy,
-                                                                       batch->batch_data[i].vertical_accuracy,
-                                                                       batch->batch_data[i].timestamp);
+                               batch->batch_data[i].latitude, batch->batch_data[i].longitude, batch->batch_data[i].altitude,
+                               batch->batch_data[i].speed, batch->batch_data[i].direction,
+                               batch->batch_data[i].horizontal_accuracy, batch->batch_data[i].vertical_accuracy,
+                               batch->batch_data[i].timestamp);
+
        return batch_dup;
 }
 
 EXPORT_API gboolean
-location_get_batch_details(const LocationBatch *batch,
-                                                       guint index,
-                                                       gdouble *latitude,
-                                                       gdouble *longitude,
-                                                       gdouble *altitude,
-                                                       gdouble *speed,
-                                                       gdouble *direction,
-                                                       gdouble *h_accuracy,
-                                                       gdouble *v_accuracy,
-                                                       guint *timestamp)
+location_get_batch_details(const LocationBatch *batch, guint index,
+                       gdouble *latitude, gdouble *longitude, gdouble *altitude,
+                       gdouble *speed, gdouble *direction, gdouble *h_accuracy, gdouble *v_accuracy, guint *timestamp)
 {
        g_return_val_if_fail(batch, FALSE);
        g_return_val_if_fail(latitude, FALSE);
@@ -207,16 +115,9 @@ location_get_batch_details(const LocationBatch *batch,
 }
 
 EXPORT_API gboolean
-location_set_batch_details(LocationBatch *batch,
-                                                       guint index,
-                                                       gdouble latitude,
-                                                       gdouble longitude,
-                                                       gdouble altitude,
-                                                       gdouble speed,
-                                                       gdouble direction,
-                                                       gdouble h_accuracy,
-                                                       gdouble v_accuracy,
-                                                       guint timestamp)
+location_set_batch_details(LocationBatch *batch, guint index,
+                       gdouble latitude, gdouble longitude, gdouble altitude,
+                       gdouble speed, gdouble direction, gdouble h_accuracy, gdouble v_accuracy, guint timestamp)
 {
        g_return_val_if_fail(batch, FALSE);
        g_return_val_if_fail(batch->batch_data, FALSE);
index 6194fa2..02b149f 100644 (file)
@@ -40,9 +40,6 @@ GType location_batch_get_type(void);
  * @{
  */
 
-/**
- * TBD
- */
 typedef struct {
        guint timestamp;                /*/< Time stamp. */
        guint level;                    /*/< Level. */
@@ -56,9 +53,6 @@ typedef struct {
        gdouble climb;                  /*/< The vertical speed. (km/h) */
 } LocationBatchDetail;
 
-/**
- * TBD
- */
 struct _LocationBatch {
        guint num_of_location;  /*/< The number of location batch. */
        time_t start_time;
@@ -67,7 +61,6 @@ struct _LocationBatch {
 
 LocationBatch *location_batch_new(int num_of_location);
 
-gboolean location_set_batch_parse_details(LocationBatch *batch, char *location_info, int i);
 
 gboolean location_get_batch_details(const LocationBatch *batch, guint index, gdouble *latitude, gdouble *longitude, gdouble *altitude, gdouble *speed, gdouble *direction, gdouble *h_accuracy, gdouble *v_accuracy, guint *timestamp);
 
@@ -75,8 +68,6 @@ gboolean location_set_batch_details(LocationBatch *batch, guint index, gdouble l
 
 LocationBatch *location_batch_copy(const LocationBatch *batch);
 
-LocationBatch *location_get_batch_file(int num_of_location);
-
 void location_batch_free(LocationBatch *batch);
 
 #ifdef TIZEN_DEVICE
index 3b5e947..34febf4 100644 (file)
@@ -90,7 +90,8 @@ static void fused_position_cb(gboolean enabled, LocationPosition *pos, LocationV
 static void fused_status_cb(gboolean enabled, LocationStatus status, gpointer self);
 
 
-static void __reset_pos_data_from_priv(LocationFusedPrivate *priv)
+static void
+__reset_pos_data_from_priv(LocationFusedPrivate *priv)
 {
        LOC_FUNC_LOG
        g_return_if_fail(priv);
@@ -115,7 +116,8 @@ static void __reset_pos_data_from_priv(LocationFusedPrivate *priv)
        priv->loc_updated_timestamp = 0;
 }
 
-static gboolean __get_started(gpointer self)
+static gboolean
+__get_started(gpointer self)
 {
        LOC_FUNC_LOG
        g_return_val_if_fail(self, FALSE);
@@ -126,7 +128,8 @@ static gboolean __get_started(gpointer self)
        return priv->is_started;
 }
 
-static int __set_started(gpointer self, gboolean started)
+static int
+__set_started(gpointer self, gboolean started)
 {
        LOC_FUNC_LOG
        g_return_val_if_fail(self, -1);
@@ -142,7 +145,8 @@ static int __set_started(gpointer self, gboolean started)
        return 0;
 }
 
-static void fused_status_cb(gboolean enabled, LocationStatus status, gpointer self)
+static void
+fused_status_cb(gboolean enabled, LocationStatus status, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(self);
@@ -152,7 +156,8 @@ static void fused_status_cb(gboolean enabled, LocationStatus status, gpointer se
        enable_signaling((gpointer)self, signals, &(priv->enabled), status != LOCATION_STATUS_NO_FIX, status);
 }
 
-static void fused_position_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
+static void
+fused_position_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(self);
@@ -168,13 +173,15 @@ static void fused_position_cb(gboolean enabled, LocationPosition *pos, LocationV
                                                        priv->min_interval, priv->min_distance, &(priv->enabled),
                                                        &(priv->dist_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
        }
+
        location_signaling(self, signals, enabled, priv->boundary_list, pos, vel, acc,
                                                priv->pos_interval, priv->vel_interval, priv->loc_interval, &(priv->enabled),
                                                &(priv->pos_updated_timestamp), &(priv->vel_updated_timestamp),
                                                &(priv->loc_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
 }
 
-static void location_setting_changed_cb(keynode_t *key, gpointer self)
+static void
+location_setting_changed_cb(keynode_t *key, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(self);
@@ -211,7 +218,8 @@ static void location_setting_changed_cb(keynode_t *key, gpointer self)
        }
 }
 
-int location_fused_start(LocationFused *self)
+static int
+location_fused_start(LocationFused *self)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(self);
@@ -269,7 +277,8 @@ int location_fused_start(LocationFused *self)
        return ret;
 }
 
-int location_fused_stop(LocationFused *self)
+static int
+location_fused_stop(LocationFused *self)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(self);
@@ -304,7 +313,8 @@ int location_fused_stop(LocationFused *self)
        return ret;
 }
 
-void location_fused_dispose(GObject *gobject)
+static void
+location_fused_dispose(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(gobject);
@@ -324,7 +334,8 @@ void location_fused_dispose(GObject *gobject)
        G_OBJECT_CLASS(location_fused_parent_class)->dispose(gobject);
 }
 
-void location_fused_finalize(GObject *gobject)
+static void
+location_fused_finalize(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(gobject);
@@ -355,7 +366,8 @@ void location_fused_finalize(GObject *gobject)
        G_OBJECT_CLASS(location_fused_parent_class)->finalize(gobject);
 }
 
-static guint get_valid_interval(guint interval, int max_interval, int min_interval)
+static guint
+get_valid_interval(guint interval, int max_interval, int min_interval)
 {
        if (interval > max_interval)
                return (guint)max_interval;
@@ -365,7 +377,8 @@ static guint get_valid_interval(guint interval, int max_interval, int min_interv
                return interval;
 }
 
-void location_fused_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+static void
+location_fused_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(object);
@@ -454,7 +467,8 @@ void location_fused_set_property(GObject *object, guint property_id, const GValu
        }
 }
 
-void location_fused_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+static void
+location_fused_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(object);
@@ -492,7 +506,8 @@ void location_fused_get_property(GObject *object, guint property_id, GValue *val
 
 }
 
-static int location_fused_get_position_ext(LocationFused *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_fused_get_position_ext(LocationFused *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(self);
@@ -524,19 +539,22 @@ static int location_fused_get_position_ext(LocationFused *self, LocationPosition
        return ret;
 }
 
-static int location_fused_get_position(LocationFused *self, LocationPosition **position, LocationAccuracy **accuracy)
+static int
+location_fused_get_position(LocationFused *self, LocationPosition **position, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        return location_fused_get_position_ext(self, position, NULL, accuracy);
 }
 
-static int location_fused_get_velocity(LocationFused *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_fused_get_velocity(LocationFused *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        return location_fused_get_position_ext(self, NULL, velocity, accuracy);
 }
 
-static int location_fused_get_last_position_ext(LocationFused *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_fused_get_last_position_ext(LocationFused *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        LocationFusedPrivate *priv = GET_PRIVATE(self);
@@ -558,61 +576,71 @@ static int location_fused_get_last_position_ext(LocationFused *self, LocationPos
        }
 }
 
-static int location_fused_get_last_position(LocationFused *self, LocationPosition **position, LocationAccuracy **accuracy)
+static int
+location_fused_get_last_position(LocationFused *self, LocationPosition **position, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        return location_fused_get_last_position_ext(self, position, NULL, accuracy);
 }
 
-static int location_fused_get_last_velocity(LocationFused *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_fused_get_last_velocity(LocationFused *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        return location_fused_get_last_position_ext(self, NULL, velocity, accuracy);
 }
 
-static int location_fused_get_satellite(LocationFused *self, LocationSatellite **satellite)
+static int
+location_fused_get_satellite(LocationFused *self, LocationSatellite **satellite)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_get_last_satellite(LocationFused *self, LocationSatellite **satellite)
+static int
+location_fused_get_last_satellite(LocationFused *self, LocationSatellite **satellite)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_get_batch(LocationFused *self, LocationBatch **batch)
+static int
+location_fused_get_batch(LocationFused *self, LocationBatch **batch)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_start_batch(LocationFused *self)
+static int
+location_fused_start_batch(LocationFused *self)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_stop_batch(LocationFused *self)
+static int
+location_fused_stop_batch(LocationFused *self)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_request_single_location(LocationFused *self, int timeout)
+static int
+location_fused_request_single_location(LocationFused *self, int timeout)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_cancel_single_location(LocationFused *self)
+static int
+location_fused_cancel_single_location(LocationFused *self)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_get_nmea(LocationFused *self, char **nmea_data)
+static int
+location_fused_get_nmea(LocationFused *self, char **nmea_data)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
@@ -625,19 +653,22 @@ location_fused_set_mock_location(LocationFused *self, LocationPosition *position
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_clear_mock_location(LocationFused *self)
+static int
+location_fused_clear_mock_location(LocationFused *self)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_set_option(LocationFused *self, const char *option)
+static int
+location_fused_set_option(LocationFused *self, const char *option)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_fused_set_fused_mode(LocationFused *self, LocationFusedMode mode)
+static int
+location_fused_set_fused_mode(LocationFused *self, LocationFusedMode mode)
 {
        LOC_FUNC_LOG
        g_return_val_if_fail(self, LOCATION_ERROR_PARAMETER);
@@ -650,7 +681,8 @@ static int location_fused_set_fused_mode(LocationFused *self, LocationFusedMode
        return LOCATION_ERROR_NONE;
 }
 
-static void location_ielement_interface_init(LocationIElementInterface *iface)
+static void
+location_ielement_interface_init(LocationIElementInterface *iface)
 {
        LOC_FUNC_LOG
        g_return_if_fail(iface);
@@ -676,7 +708,8 @@ static void location_ielement_interface_init(LocationIElementInterface *iface)
        iface->clear_mock_location = (TYPE_CLEAR_MOCK_LOCATION) location_fused_clear_mock_location;
 }
 
-static void location_fused_init(LocationFused *self)
+static void
+location_fused_init(LocationFused *self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(self);
@@ -707,7 +740,8 @@ static void location_fused_init(LocationFused *self)
        LOC_COND_LOG(priv->app_type == 0, _W, "Fail to get app_type");
 }
 
-static void location_fused_class_init(LocationFusedClass *klass)
+static void
+location_fused_class_init(LocationFusedClass *klass)
 {
        LOC_FUNC_LOG
        g_return_if_fail(klass);
@@ -720,24 +754,95 @@ static void location_fused_class_init(LocationFusedClass *klass)
 
        g_type_class_add_private(klass, sizeof(LocationFusedPrivate));
 
-       signals[SERVICE_ENABLED]  = g_signal_new("service-enabled",  G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, enabled),          NULL, NULL, location_VOID__UINT,                        G_TYPE_NONE, 1, G_TYPE_UINT);
-       signals[SERVICE_DISABLED] = g_signal_new("service-disabled", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, disabled),         NULL, NULL, location_VOID__UINT,                        G_TYPE_NONE, 1, G_TYPE_UINT);
-       signals[SERVICE_UPDATED]  = g_signal_new("service-updated",  G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, service_updated),  NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER, G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
-       signals[LOCATION_UPDATED] = g_signal_new("location-updated", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, location_updated), NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER, G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
-       signals[ZONE_IN]          = g_signal_new("zone-in",          G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, zone_in),          NULL, NULL, location_VOID__POINTER_POINTER_POINTER,     G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
-       signals[ZONE_OUT]         = g_signal_new("zone-out",         G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE, G_STRUCT_OFFSET(LocationFusedClass, zone_out),         NULL, NULL, location_VOID__POINTER_POINTER_POINTER,     G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
-
-       properties[PROP_METHOD_TYPE]      = g_param_spec_int("method",             "method type",                  "location method type name (fused)", LOCATION_METHOD_FUSED, LOCATION_METHOD_FUSED, LOCATION_METHOD_FUSED, G_PARAM_READABLE);
-       properties[PROP_IS_STARTED]       = g_param_spec_boolean("is_started",     "fused is started prop",        "status of the fused location", FALSE, G_PARAM_READWRITE);
-       properties[PROP_LAST_POSITION]    = g_param_spec_boxed("last-position",    "fused last position prop",     "last fused position", LOCATION_TYPE_POSITION, G_PARAM_READABLE);
-       properties[PROP_POS_INTERVAL]     = g_param_spec_uint("pos-interval",      "pos-int prop",                 "desired signaling interval of position", LOCATION_UPDATE_INTERVAL_MIN, LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
-       properties[PROP_VEL_INTERVAL]     = g_param_spec_uint("vel-interval",      "vel-int prop",                 "desired signaling interval of velocity", LOCATION_UPDATE_INTERVAL_MIN, LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
-       properties[PROP_LOC_INTERVAL]     = g_param_spec_uint("loc-interval",      "loc-int prop",                 "desired signaling interval of entire location", LOCATION_UPDATE_INTERVAL_MIN, LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
-       properties[PROP_MIN_INTERVAL]     = g_param_spec_uint("min-interval",      "min-int prop",                 "minimal signaling interval", LOCATION_MIN_INTERVAL_MIN, LOCATION_MIN_INTERVAL_MAX, LOCATION_MIN_INTERVAL_DEFAULT, G_PARAM_READWRITE);
-       properties[PROP_MIN_DISTANCE]     = g_param_spec_double("min-distance",    "min-dist prop",                "minimal signaling distance", LOCATION_MIN_DISTANCE_MIN, LOCATION_MIN_DISTANCE_MAX, LOCATION_MIN_DISTANCE_DEFAULT, G_PARAM_READWRITE);
-       properties[PROP_BOUNDARY]         = g_param_spec_pointer("boundary",       "fused boundary prop",          "fused boundary data", G_PARAM_READWRITE);
-       properties[PROP_REMOVAL_BOUNDARY] = g_param_spec_boxed("removal-boundary", "fused removal boundary prop",  "fused removal boundary data", LOCATION_TYPE_BOUNDARY, G_PARAM_READWRITE);
-       properties[PROP_SERVICE_STATUS]   = g_param_spec_int("service-status",     "location service status prop", "location service status data", LOCATION_STATUS_NO_FIX, LOCATION_STATUS_3D_FIX, LOCATION_STATUS_NO_FIX, G_PARAM_READABLE);
+       signals[SERVICE_ENABLED] =
+                       g_signal_new("service-enabled",  G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, enabled),
+                       NULL, NULL, location_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
+
+       signals[SERVICE_DISABLED] =
+                       g_signal_new("service-disabled", G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, disabled),
+                       NULL, NULL, location_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
+
+       signals[SERVICE_UPDATED] =
+                       g_signal_new("service-updated",  G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, service_updated),
+                       NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER,
+                       G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
+
+       signals[LOCATION_UPDATED] =
+                       g_signal_new("location-updated", G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, location_updated),
+                       NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER,
+                       G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
+
+       signals[ZONE_IN] =
+                       g_signal_new("zone-in", G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, zone_in),
+                       NULL, NULL, location_VOID__POINTER_POINTER_POINTER,
+                       G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
+
+       signals[ZONE_OUT] =
+                       g_signal_new("zone-out", G_TYPE_FROM_CLASS(klass),
+                       G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+                       G_STRUCT_OFFSET(LocationFusedClass, zone_out),
+                       NULL, NULL, location_VOID__POINTER_POINTER_POINTER,
+                       G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
+
+       properties[PROP_METHOD_TYPE] =
+                       g_param_spec_int("method", "method type", "location method type name (fused)",
+                       LOCATION_METHOD_FUSED, LOCATION_METHOD_FUSED, LOCATION_METHOD_FUSED, G_PARAM_READABLE);
+
+       properties[PROP_IS_STARTED] =
+                       g_param_spec_boolean("is_started", "fused is started prop",
+                       "status of the fused location", FALSE, G_PARAM_READWRITE);
+
+       properties[PROP_LAST_POSITION] =
+                       g_param_spec_boxed("last-position", "fused last position prop",
+                       "last fused position", LOCATION_TYPE_POSITION, G_PARAM_READABLE);
+
+       properties[PROP_POS_INTERVAL] =
+                       g_param_spec_uint("pos-interval", "pos-int prop",
+                       "desired signaling interval of position", LOCATION_UPDATE_INTERVAL_MIN,
+                       LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
+
+       properties[PROP_VEL_INTERVAL] =
+                       g_param_spec_uint("vel-interval", "vel-int prop",
+                       "desired signaling interval of velocity", LOCATION_UPDATE_INTERVAL_MIN,
+                       LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
+
+       properties[PROP_LOC_INTERVAL] =
+                       g_param_spec_uint("loc-interval", "loc-int prop",
+                       "desired signaling interval of entire location", LOCATION_UPDATE_INTERVAL_MIN,
+                       LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
+
+       properties[PROP_MIN_INTERVAL] =
+                       g_param_spec_uint("min-interval", "min-int prop",
+                       "minimal signaling interval", LOCATION_MIN_INTERVAL_MIN,
+                       LOCATION_MIN_INTERVAL_MAX, LOCATION_MIN_INTERVAL_DEFAULT, G_PARAM_READWRITE);
+
+       properties[PROP_MIN_DISTANCE] =
+                       g_param_spec_double("min-distance", "min-dist prop",
+                       "minimal signaling distance", LOCATION_MIN_DISTANCE_MIN,
+                       LOCATION_MIN_DISTANCE_MAX, LOCATION_MIN_DISTANCE_DEFAULT, G_PARAM_READWRITE);
+
+       properties[PROP_BOUNDARY] =
+                       g_param_spec_pointer("boundary", "fused boundary prop",
+                       "fused boundary data", G_PARAM_READWRITE);
+
+       properties[PROP_REMOVAL_BOUNDARY] =
+                       g_param_spec_boxed("removal-boundary", "fused removal boundary prop",
+                       "fused removal boundary data", LOCATION_TYPE_BOUNDARY, G_PARAM_READWRITE);
+
+       properties[PROP_SERVICE_STATUS] =
+                       g_param_spec_int("service-status", "location service status prop",
+                       "location service status data", LOCATION_STATUS_NO_FIX,
+                       LOCATION_STATUS_3D_FIX, LOCATION_STATUS_NO_FIX, G_PARAM_READABLE);
 
        g_object_class_install_properties(gobject_class, PROP_MAX, properties);
 }
index 8df47ae..9372b82 100644 (file)
@@ -103,7 +103,8 @@ static int location_gps_cancel_single_location(LocationGps *self);
 G_DEFINE_TYPE_WITH_CODE(LocationGps, location_gps, G_TYPE_OBJECT,
                                                G_IMPLEMENT_INTERFACE(LOCATION_TYPE_IELEMENT, location_ielement_interface_init));
 
-static void __reset_pos_data_from_priv(LocationGpsPrivate *priv)
+static void
+__reset_pos_data_from_priv(LocationGpsPrivate *priv)
 {
        LOC_FUNC_LOG
        g_return_if_fail(priv);
@@ -138,7 +139,8 @@ static void __reset_pos_data_from_priv(LocationGpsPrivate *priv)
        priv->loc_updated_timestamp = 0;
 }
 
-static gboolean __get_started(gpointer self)
+static gboolean
+__get_started(gpointer self)
 {
        g_return_val_if_fail(self, FALSE);
 
@@ -148,7 +150,8 @@ static gboolean __get_started(gpointer self)
        return priv->is_started;
 }
 
-static int __set_started(gpointer self, gboolean started)
+static int
+__set_started(gpointer self, gboolean started)
 {
        g_return_val_if_fail(self, -1);
 
@@ -164,7 +167,8 @@ static int __set_started(gpointer self, gboolean started)
        return 0;
 }
 
-static void gps_status_cb(gboolean enabled, LocationStatus status, gpointer self)
+static void
+gps_status_cb(gboolean enabled, LocationStatus status, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(self);
@@ -178,7 +182,8 @@ static void gps_status_cb(gboolean enabled, LocationStatus status, gpointer self
        }
 }
 
-static void gps_location_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
+static void
+gps_location_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
 {
        g_return_if_fail(self);
        g_return_if_fail(pos);
@@ -193,6 +198,7 @@ static void gps_location_cb(gboolean enabled, LocationPosition *pos, LocationVel
                                                        priv->min_interval, priv->min_distance, &(priv->enabled),
                                                        &(priv->dist_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
        }
+
        location_signaling(self, signals, enabled, priv->boundary_list, pos, vel, acc,
                                                priv->pos_interval, priv->vel_interval, priv->loc_interval, &(priv->enabled),
                                                &(priv->pos_updated_timestamp), &(priv->vel_updated_timestamp),
@@ -200,8 +206,10 @@ static void gps_location_cb(gboolean enabled, LocationPosition *pos, LocationVel
 }
 
 #ifndef TIZEN_DEVICE
-static void gps_batch_cb(gboolean enabled, guint num_of_location, gpointer self)
+static void
+gps_batch_cb(gboolean enabled, guint num_of_location, LocationBatch *batch, gpointer self)
 {
+       LOC_FUNC_LOG
        g_return_if_fail(self);
        LocationGpsPrivate *priv = GET_PRIVATE(self);
        g_return_if_fail(priv);
@@ -209,13 +217,14 @@ static void gps_batch_cb(gboolean enabled, guint num_of_location, gpointer self)
        if (priv->batch != NULL)
                location_batch_free(priv->batch);
 
-       priv->batch = location_get_batch_file(num_of_location);
+       priv->batch = location_batch_copy(batch);
 
        g_signal_emit(self, signals[BATCH_UPDATED], 0, num_of_location);
 }
 #endif
 
-static void gps_satellite_cb(gboolean enabled, LocationSatellite *sat, gpointer self)
+static void
+gps_satellite_cb(gboolean enabled, LocationSatellite *sat, gpointer self)
 {
        g_return_if_fail(self);
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -224,7 +233,8 @@ static void gps_satellite_cb(gboolean enabled, LocationSatellite *sat, gpointer
        satellite_signaling(self, signals, &(priv->enabled), priv->sat_interval, TRUE, &(priv->sat_updated_timestamp), &(priv->sat), sat);
 }
 
-static void location_setting_search_cb(keynode_t *key, gpointer self)
+static void
+location_setting_search_cb(keynode_t *key, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(key);
@@ -240,7 +250,8 @@ static void location_setting_search_cb(keynode_t *key, gpointer self)
        }
 }
 
-static void location_setting_gps_cb(keynode_t *key, gpointer self)
+static void
+location_setting_gps_cb(keynode_t *key, gpointer self)
 {
        LOC_FUNC_LOG
        g_return_if_fail(key);
@@ -272,7 +283,8 @@ static void location_setting_gps_cb(keynode_t *key, gpointer self)
        }
 }
 
-static int location_gps_start(LocationGps *self)
+static int
+location_gps_start(LocationGps *self)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -309,7 +321,8 @@ static int location_gps_start(LocationGps *self)
        return ret;
 }
 
-static int location_gps_stop(LocationGps *self)
+static int
+location_gps_stop(LocationGps *self)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -340,7 +353,8 @@ static int location_gps_stop(LocationGps *self)
 }
 
 #if defined(TIZEN_DEVICE)
-static void __sensor_event_cb(sensor_h s, sensor_event_s *event, void *data)
+static void
+__sensor_event_cb(sensor_h s, sensor_event_s *event, void *data)
 {
        LocationGpsPrivate *priv = GET_PRIVATE(data);
        g_return_if_fail(priv);
@@ -372,7 +386,8 @@ static void __sensor_event_cb(sensor_h s, sensor_event_s *event, void *data)
        }
 }
 
-static int __set_sensor_batch(LocationGps *self, int batch_interval)
+static int
+__set_sensor_batch(LocationGps *self, int batch_interval)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -421,7 +436,8 @@ static int __set_sensor_batch(LocationGps *self, int batch_interval)
 }
 #endif
 
-static int location_gps_start_batch(LocationGps *self)
+static int
+location_gps_start_batch(LocationGps *self)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -455,7 +471,8 @@ static int location_gps_start_batch(LocationGps *self)
        return ret;
 }
 
-static int location_gps_stop_batch(LocationGps *self)
+static int
+location_gps_stop_batch(LocationGps *self)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -490,7 +507,8 @@ static int location_gps_stop_batch(LocationGps *self)
        return ret;
 }
 
-static void location_gps_dispose(GObject *gobject)
+static void
+location_gps_dispose(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(gobject);
@@ -516,7 +534,8 @@ static void location_gps_dispose(GObject *gobject)
        G_OBJECT_CLASS(location_gps_parent_class)->dispose(gobject);
 }
 
-static void location_gps_finalize(GObject *gobject)
+static void
+location_gps_finalize(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(gobject);
@@ -557,7 +576,8 @@ static void location_gps_finalize(GObject *gobject)
        G_OBJECT_CLASS(location_gps_parent_class)->finalize(gobject);
 }
 
-static guint get_valid_interval(guint interval, int max_interval, int min_interval)
+static guint
+get_valid_interval(guint interval, int max_interval, int min_interval)
 {
        if (interval > max_interval)
                return (guint)max_interval;
@@ -567,7 +587,8 @@ static guint get_valid_interval(guint interval, int max_interval, int min_interv
                return interval;
 }
 
-static void location_gps_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+static void
+location_gps_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 {
        LocationGpsPrivate *priv = GET_PRIVATE(object);
        g_return_if_fail(priv);
@@ -675,7 +696,8 @@ static void location_gps_set_property(GObject *object, guint property_id, const
        }
 }
 
-static void location_gps_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+static void
+location_gps_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
 {
        LocationGpsPrivate *priv = GET_PRIVATE(object);
        g_return_if_fail(priv);
@@ -752,7 +774,8 @@ static void location_gps_get_property(GObject *object, guint property_id, GValue
        }
 }
 
-static int location_gps_get_position(LocationGps *self, LocationPosition **position, LocationAccuracy **accuracy)
+static int
+location_gps_get_position(LocationGps *self, LocationPosition **position, LocationAccuracy **accuracy)
 {
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -871,7 +894,8 @@ location_gps_get_last_velocity(LocationGps *self, LocationVelocity **velocity, L
        return ret;
 }
 
-static gboolean __single_location_timeout_cb(void *data)
+static gboolean
+__single_location_timeout_cb(void *data)
 {
        LOC_FUNC_LOG
        LocationGps *self = (LocationGps *)data;
@@ -970,7 +994,8 @@ location_gps_cancel_single_location(LocationGps *self)
        return ret;
 }
 
-static int location_gps_get_nmea(LocationGps *self, char **nmea_data)
+static int
+location_gps_get_nmea(LocationGps *self, char **nmea_data)
 {
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
 
@@ -987,7 +1012,8 @@ static int location_gps_get_nmea(LocationGps *self, char **nmea_data)
        return ret;
 }
 
-static int location_gps_get_batch(LocationGps *self, LocationBatch **batch)
+static int
+location_gps_get_batch(LocationGps *self, LocationBatch **batch)
 {
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
 
@@ -1011,7 +1037,8 @@ static int location_gps_get_batch(LocationGps *self, LocationBatch **batch)
        return ret;
 }
 
-static int location_gps_get_satellite(LocationGps *self, LocationSatellite **satellite)
+static int
+location_gps_get_satellite(LocationGps *self, LocationSatellite **satellite)
 {
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
 
@@ -1029,12 +1056,14 @@ static int location_gps_get_satellite(LocationGps *self, LocationSatellite **sat
        return ret;
 }
 
-static int location_gps_get_last_satellite(LocationGps *self, LocationSatellite **satellite)
+static int
+location_gps_get_last_satellite(LocationGps *self, LocationSatellite **satellite)
 {
        return location_gps_get_satellite(self, satellite);
 }
 
-static int location_gps_set_option(LocationGps *self, const char *option)
+static int
+location_gps_set_option(LocationGps *self, const char *option)
 {
        LocationGpsPrivate *priv = GET_PRIVATE(self);
        g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
@@ -1100,7 +1129,8 @@ location_gps_set_fused_mode(LocationGps *self, LocationFusedMode mode)
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static void location_ielement_interface_init(LocationIElementInterface *iface)
+static void
+location_ielement_interface_init(LocationIElementInterface *iface)
 {
        iface->start = (TYPE_START_FUNC)location_gps_start;
        iface->stop = (TYPE_STOP_FUNC)location_gps_stop;
@@ -1124,7 +1154,8 @@ static void location_ielement_interface_init(LocationIElementInterface *iface)
        iface->set_fused_mode = (TYPE_SET_FUSED_MODE) location_gps_set_fused_mode;
 }
 
-static void location_gps_init(LocationGps *self)
+static void
+location_gps_init(LocationGps *self)
 {
        LOC_FUNC_LOG
        LocationGpsPrivate *priv = GET_PRIVATE(self);
@@ -1171,7 +1202,8 @@ static void location_gps_init(LocationGps *self)
        LOC_COND_LOG(priv->app_type == 0, _W, "Fail to get app_type");
 }
 
-static void location_gps_class_init(LocationGpsClass *klass)
+static void
+location_gps_class_init(LocationGpsClass *klass)
 {
        LOC_FUNC_LOG
        GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
index 9d6a2f6..186a55f 100644 (file)
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
-#ifndef __LOCATION_HYBRID_MOBILE_H__
-#define __LOCATION_HYBRID_MOBILE_H__
+#ifndef __LOCATION_HYBRID_H__
+#define __LOCATION_HYBRID_H__
 
 #include <glib-object.h>
 
index 4786c0c..accae68 100644 (file)
@@ -87,7 +87,8 @@ static void location_ielement_interface_init(LocationIElementInterface *iface);
 G_DEFINE_TYPE_WITH_CODE(LocationPassive, location_passive, G_TYPE_OBJECT,
                                                G_IMPLEMENT_INTERFACE(LOCATION_TYPE_IELEMENT, location_ielement_interface_init));
 
-static void __reset_pos_data_from_priv(LocationPassivePrivate *priv)
+static void
+__reset_pos_data_from_priv(LocationPassivePrivate *priv)
 {
        LOC_FUNC_LOG
        g_return_if_fail(priv);
@@ -114,7 +115,8 @@ static void __reset_pos_data_from_priv(LocationPassivePrivate *priv)
        priv->loc_updated_timestamp = 0;
 }
 
-static gboolean __get_started(gpointer self)
+static gboolean
+__get_started(gpointer self)
 {
        LocationPassivePrivate *priv = GET_PRIVATE(self);
        g_return_val_if_fail(priv, FALSE);
@@ -122,7 +124,8 @@ static gboolean __get_started(gpointer self)
        return priv->is_started;
 }
 
-static int __set_started(gpointer self, gboolean started)
+static int
+__set_started(gpointer self, gboolean started)
 {
        LocationPassivePrivate *priv = GET_PRIVATE(self);
        g_return_val_if_fail(priv, -1);
@@ -136,7 +139,8 @@ static int __set_started(gpointer self, gboolean started)
        return 0;
 }
 
-static void passive_location_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
+static void
+passive_location_cb(gboolean enabled, LocationPosition *pos, LocationVelocity *vel, LocationAccuracy *acc, gpointer self)
 {
        g_return_if_fail(self);
        g_return_if_fail(pos);
@@ -157,7 +161,8 @@ static void passive_location_cb(gboolean enabled, LocationPosition *pos, Locatio
                                                &(priv->loc_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
 }
 
-static void passive_satellite_cb(gboolean enabled, LocationSatellite *sat, gpointer self)
+static void
+passive_satellite_cb(gboolean enabled, LocationSatellite *sat, gpointer self)
 {
        g_return_if_fail(self);
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -166,7 +171,8 @@ static void passive_satellite_cb(gboolean enabled, LocationSatellite *sat, gpoin
        satellite_signaling(self, signals, &(priv->enabled), priv->sat_interval, TRUE, &(priv->sat_updated_timestamp), &(priv->sat), sat);
 }
 
-static int location_passive_start(LocationPassive *self)
+static int
+location_passive_start(LocationPassive *self)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -198,7 +204,8 @@ static int location_passive_start(LocationPassive *self)
        return ret;
 }
 
-static int location_passive_stop(LocationPassive *self)
+static int
+location_passive_stop(LocationPassive *self)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -224,7 +231,8 @@ static int location_passive_stop(LocationPassive *self)
        return ret;
 }
 
-static void location_passive_dispose(GObject *gobject)
+static void
+location_passive_dispose(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(gobject);
@@ -238,7 +246,8 @@ static void location_passive_dispose(GObject *gobject)
        G_OBJECT_CLASS(location_passive_parent_class)->dispose(gobject);
 }
 
-static void location_passive_finalize(GObject *gobject)
+static void
+location_passive_finalize(GObject *gobject)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(gobject);
@@ -266,7 +275,8 @@ static void location_passive_finalize(GObject *gobject)
        G_OBJECT_CLASS(location_passive_parent_class)->finalize(gobject);
 }
 
-static guint get_valid_interval(guint interval, int max_interval, int min_interval)
+static guint
+get_valid_interval(guint interval, int max_interval, int min_interval)
 {
        if (interval > max_interval)
                return (guint)max_interval;
@@ -276,7 +286,8 @@ static guint get_valid_interval(guint interval, int max_interval, int min_interv
                return interval;
 }
 
-static void location_passive_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+static void
+location_passive_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 {
        LocationPassivePrivate *priv = GET_PRIVATE(object);
        g_return_if_fail(priv);
@@ -383,7 +394,8 @@ static void location_passive_set_property(GObject *object, guint property_id, co
        }
 }
 
-static void location_passive_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+static void
+location_passive_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
 {
        LocationPassivePrivate *priv = GET_PRIVATE(object);
        g_return_if_fail(priv);
@@ -443,7 +455,8 @@ static void location_passive_get_property(GObject *object, guint property_id, GV
        }
 }
 
-static int location_passive_get_position(LocationPassive *self, LocationPosition **position, LocationAccuracy **accuracy)
+static int
+location_passive_get_position(LocationPassive *self, LocationPosition **position, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
@@ -468,7 +481,8 @@ static int location_passive_get_position(LocationPassive *self, LocationPosition
        return ret;
 }
 
-static int location_passive_get_position_ext(LocationPassive *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_passive_get_position_ext(LocationPassive *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
@@ -495,7 +509,8 @@ static int location_passive_get_position_ext(LocationPassive *self, LocationPosi
 }
 
 
-static int location_passive_get_last_position(LocationPassive *self, LocationPosition **position, LocationAccuracy **accuracy)
+static int
+location_passive_get_last_position(LocationPassive *self, LocationPosition **position, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -516,7 +531,8 @@ static int location_passive_get_last_position(LocationPassive *self, LocationPos
        return ret;
 }
 
-static int location_passive_get_last_position_ext(LocationPassive *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_passive_get_last_position_ext(LocationPassive *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -531,7 +547,8 @@ static int location_passive_get_last_position_ext(LocationPassive *self, Locatio
        return ops.get_last_position(priv->mod->handler, position, velocity, accuracy);
 }
 
-static int location_passive_get_velocity(LocationPassive *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_passive_get_velocity(LocationPassive *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        int ret = LOCATION_ERROR_NOT_AVAILABLE;
 
@@ -555,7 +572,8 @@ static int location_passive_get_velocity(LocationPassive *self, LocationVelocity
        return ret;
 }
 
-static int location_passive_get_last_velocity(LocationPassive *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
+static int
+location_passive_get_last_velocity(LocationPassive *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -574,7 +592,8 @@ static int location_passive_get_last_velocity(LocationPassive *self, LocationVel
        return ret;
 }
 
-static int location_passive_get_satellite(LocationPassive *self, LocationSatellite **satellite)
+static int
+location_passive_get_satellite(LocationPassive *self, LocationSatellite **satellite)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -592,55 +611,64 @@ static int location_passive_get_satellite(LocationPassive *self, LocationSatelli
        return ret;
 }
 
-static int location_passive_get_last_satellite(LocationPassive *self, LocationSatellite **satellite)
+static int
+location_passive_get_last_satellite(LocationPassive *self, LocationSatellite **satellite)
 {
        LOC_FUNC_LOG
        return location_passive_get_satellite(self, satellite);
 }
 
-static int location_passive_set_option(LocationPassive *self, const char *option)
+static int
+location_passive_set_option(LocationPassive *self, const char *option)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NONE;
 }
 
-static int location_passive_request_single_location(LocationPassive *self, int timeout)
+static int
+location_passive_request_single_location(LocationPassive *self, int timeout)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_passive_cancel_single_location(LocationPassive *self, int timeout)
+static int
+location_passive_cancel_single_location(LocationPassive *self, int timeout)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_passive_get_nmea(LocationPassive *self, char **nmea_data)
+static int
+location_passive_get_nmea(LocationPassive *self, char **nmea_data)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_passive_set_mock_location(LocationPassive *self, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy)
+static int
+location_passive_set_mock_location(LocationPassive *self, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_passive_clear_mock_location(LocationPassive *self)
+static int
+location_passive_clear_mock_location(LocationPassive *self)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static int location_passive_set_fused_mode(LocationPassive *self, LocationFusedMode mode)
+static int
+location_passive_set_fused_mode(LocationPassive *self, LocationFusedMode mode)
 {
        LOC_FUNC_LOG
        return LOCATION_ERROR_NOT_SUPPORTED;
 }
 
-static void location_ielement_interface_init(LocationIElementInterface *iface)
+static void
+location_ielement_interface_init(LocationIElementInterface *iface)
 {
        iface->start = (TYPE_START_FUNC)location_passive_start;
        iface->stop = (TYPE_STOP_FUNC)location_passive_stop;
@@ -661,7 +689,8 @@ static void location_ielement_interface_init(LocationIElementInterface *iface)
        iface->set_fused_mode = (TYPE_SET_FUSED_MODE) location_passive_set_fused_mode;
 }
 
-static void location_passive_init(LocationPassive *self)
+static void
+location_passive_init(LocationPassive *self)
 {
        LOC_FUNC_LOG
        LocationPassivePrivate *priv = GET_PRIVATE(self);
@@ -698,7 +727,8 @@ static void location_passive_init(LocationPassive *self)
        LOC_COND_LOG(priv->app_type == 0, _W, "[Info] Fail to get app_type");
 }
 
-static void location_passive_class_init(LocationPassiveClass *klass)
+static void
+location_passive_class_init(LocationPassiveClass *klass)
 {
        LOC_FUNC_LOG
        GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
index d7cc21d..ee86d2c 100644 (file)
 
 #include <glib.h>
 #include <bundle_internal.h>
-#include <eventsystem.h>
 #include "location-log.h"
 #include "location-setting.h"
 
-#ifdef EVENT_SYSTEM
-static unsigned int g_event_req_id;
-#endif
-
 gint location_setting_get_key_val(keynode_t *key)
 {
        g_return_val_if_fail(key, -1);
@@ -66,47 +61,11 @@ gboolean location_setting_get_bool(const gchar *path)
        return val;
 }
 
-#ifdef EVENT_SYSTEM
-static char *__convert_event_from_vconf(const char *vconf)
-{
-       char *event = NULL;
-       if (g_strcmp0(vconf, VCONFKEY_LOCATION_USE_MY_LOCATION) == 0)
-               event = g_strdup(SYS_EVENT_LOCATION_ENABLE_STATE);
-       else if (g_strcmp0(vconf, VCONFKEY_LOCATION_ENABLED) == 0)
-               event = g_strdup(SYS_EVENT_GPS_ENABLE_STATE);
-       else if (g_strcmp0(vconf, VCONFKEY_LOCATION_NETWORK_ENABLED) == 0)
-               event = g_strdup(SYS_EVENT_NPS_ENABLE_STATE);
-
-       return event;
-}
-
-static void __event_handler(const char *event_name, bundle *data, void *self)
-{
-       const char *value = NULL;
-
-       if (g_strcmp0(event_name, SYS_EVENT_LOCATION_ENABLE_STATE) == 0)
-               value = bundle_get_val(data, EVT_KEY_LOCATION_ENABLE_STATE);
-       else if (g_strcmp0(event_name, SYS_EVENT_GPS_ENABLE_STATE) == 0)
-               value = bundle_get_val(data, EVT_KEY_GPS_ENABLE_STATE);
-       else if (g_strcmp0(event_name, SYS_EVENT_NPS_ENABLE_STATE) == 0)
-               value = bundle_get_val(data, EVT_KEY_NPS_ENABLE_STATE);
-
-       LOCATION_SECLOG("[%s: %s]", event_name, value);
-}
-#endif
-
 gint location_setting_add_notify(const gchar *path, SettingCB setting_cb, gpointer self)
 {
        g_return_val_if_fail(path, -1);
        g_return_val_if_fail(self, -1);
 
-#ifdef EVENT_SYSTEM
-       const char *event_name = NULL;
-       event_name = __convert_event_from_vconf(path);
-
-       if (eventsystem_register_event(event_name, &g_event_req_id, (eventsystem_handler) __event_handler, NULL) != ES_R_OK)
-               LOCATION_SECLOG("eventsystem_register_event failed");
-#endif
        if (vconf_notify_key_changed(path, setting_cb, self)) {
                LOCATION_SECLOG("vconf notify add failed [%s]", path);
                return -1;
@@ -120,11 +79,6 @@ gint location_setting_ignore_notify(const gchar *path, SettingCB setting_cb)
        g_return_val_if_fail(path, -1);
        g_return_val_if_fail(setting_cb, -1);
 
-#ifdef EVENT_SYSTEM
-       if (eventsystem_unregister_event(g_event_req_id) != ES_R_OK)
-               LOCATION_SECLOG("eventsystem_unregister_event failed");
-#endif
-
        if (vconf_ignore_key_changed(path, setting_cb)) {
                LOCATION_SECLOG("vconf notify remove failed [%s]", path);
                return -1;
index cb4b2a3..3fbb172 100644 (file)
@@ -57,7 +57,7 @@ typedef void (*LocModPositionExtCB)(gboolean enabled, LocationPosition *position
 /**
  * @brief This represents a batch callback function for a plug-in.
  */
-typedef void (*LocModBatchExtCB)(gboolean enabled, guint num_of_location, gpointer userdata);
+typedef void (*LocModBatchExtCB)(gboolean enabled, guint num_of_location, LocationBatch *batch, gpointer userdata);
 
 /**
  * @brief This represents a velocity callback function for a plug-in.
index 1a0f800..f411277 100755 (executable)
@@ -1,6 +1,6 @@
 Name: liblbs-location
 Summary: Location Based Service Library
-Version: 1.4.2
+Version: 1.4.4
 Release: 1
 Group: Location/Libraries
 License: Apache-2.0
@@ -18,7 +18,6 @@ BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(json-glib-1.0)
 BuildRequires:  pkgconfig(bundle)
-BuildRequires:  pkgconfig(eventsystem)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-system-sensor)