4 * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 #include "location-setting.h"
24 #include "location-log.h"
26 #include "module-internal.h"
28 #include "location-hybrid.h"
29 #include "location-marshal.h"
30 #include "location-ielement.h"
31 #include "location-signaling-util.h"
32 #include "location-common-util.h"
34 #include "location-gps.h"
35 #include "location-wps.h"
37 typedef struct _LocationHybridPrivate {
41 guint pos_updated_timestamp;
42 guint vel_updated_timestamp;
43 guint sat_updated_timestamp;
44 guint dist_updated_timestamp;
45 guint loc_updated_timestamp;
55 LocationMethod current_method;
56 LocationPosition *pos;
57 LocationVelocity *vel;
58 LocationAccuracy *acc;
59 LocationSatellite *sat;
64 } LocationHybridPrivate;
75 PROP_REMOVAL_BOUNDARY,
82 static guint32 signals[LAST_SIGNAL] = {0, };
83 static GParamSpec *properties[PROP_MAX] = {NULL, };
85 #define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), LOCATION_TYPE_HYBRID, LocationHybridPrivate))
87 static void location_ielement_interface_init(LocationIElementInterface *iface);
89 G_DEFINE_TYPE_WITH_CODE(LocationHybrid, location_hybrid, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(LOCATION_TYPE_IELEMENT, location_ielement_interface_init));
92 __get_availability_use_location(gpointer self)
94 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED) && !location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED))
95 return LOCATION_ERROR_SETTING_OFF;
97 return LOCATION_ERROR_NONE;
100 static LocationMethod
101 hybrid_get_current_method(LocationHybridPrivate *priv)
103 g_return_val_if_fail(priv, LOCATION_METHOD_NONE);
104 LOCATION_LOGD("Current Method [%d]", priv->current_method);
105 return priv->current_method;
109 hybrid_set_current_method(LocationHybridPrivate *priv, GType g_type)
111 g_return_val_if_fail(priv, FALSE);
113 if (g_type == LOCATION_TYPE_GPS)
114 priv->current_method = LOCATION_METHOD_GPS;
115 else if (g_type == LOCATION_TYPE_WPS)
116 priv->current_method = LOCATION_METHOD_WPS;
117 else if (g_type == LOCATION_TYPE_HYBRID)
118 priv->current_method = LOCATION_METHOD_HYBRID;
126 hybrid_get_update_method(LocationHybridPrivate *priv)
128 if (!priv->gps && !priv->wps)
131 if (priv->gps_enabled)
132 hybrid_set_current_method(priv, LOCATION_TYPE_GPS);
133 else if (priv->wps_enabled)
134 hybrid_set_current_method(priv, LOCATION_TYPE_WPS);
136 hybrid_set_current_method(priv, LOCATION_TYPE_HYBRID);
141 static gboolean /* True : Receive more accurate info. False : Receive less accurate info */
142 hybrid_compare_g_type_method(LocationHybridPrivate *priv, GType g_type)
144 if (g_type == LOCATION_TYPE_GPS) {
145 hybrid_set_current_method(priv, LOCATION_TYPE_GPS);
147 } else if (g_type == LOCATION_TYPE_WPS && hybrid_get_current_method(priv) == LOCATION_METHOD_WPS) {
148 hybrid_set_current_method(priv, LOCATION_TYPE_WPS);
155 _location_timeout_cb(gpointer data)
157 GObject *object = (GObject *)data;
158 if (!object) return FALSE;
159 LocationHybridPrivate *priv = GET_PRIVATE(object);
160 g_return_val_if_fail(priv, FALSE);
162 LocationPosition *pos = NULL;
163 LocationVelocity *vel = NULL;
164 LocationAccuracy *acc = NULL;
167 pos = location_position_copy(priv->pos);
169 pos = location_position_new(0, 0.0, 0.0, 0.0, LOCATION_STATUS_NO_FIX);
172 vel = location_velocity_copy(priv->vel);
174 vel = location_velocity_new(0, 0.0, 0.0, 0.0);
177 acc = location_accuracy_copy(priv->acc);
179 acc = location_accuracy_new(LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
181 g_signal_emit(object, signals[SERVICE_UPDATED], 0, priv->signal_type, pos, vel, acc);
182 priv->signal_type = 0;
184 if (pos) location_position_free(pos);
185 if (vel) location_velocity_free(vel);
186 if (acc) location_accuracy_free(acc);
192 _position_timeout_cb(gpointer data)
194 GObject *object = (GObject *)data;
195 if (!object) return FALSE;
196 LocationHybridPrivate *priv = GET_PRIVATE(object);
197 g_return_val_if_fail(priv, FALSE);
199 if (priv->pos_interval == priv->vel_interval) {
200 priv->signal_type |= POSITION_UPDATED;
201 priv->signal_type |= VELOCITY_UPDATED;
203 priv->signal_type |= POSITION_UPDATED;
205 _location_timeout_cb(object);
211 _velocity_timeout_cb(gpointer data)
213 GObject *object = (GObject *)data;
214 LocationHybridPrivate *priv = GET_PRIVATE(object);
215 g_return_val_if_fail(priv, FALSE);
217 if (priv->pos_interval != priv->vel_interval) {
218 priv->signal_type |= VELOCITY_UPDATED;
219 _location_timeout_cb(object);
226 location_hybrid_gps_cb(keynode_t *key, gpointer self)
229 g_return_if_fail(key);
230 g_return_if_fail(self);
231 LocationHybridPrivate *priv = GET_PRIVATE(self);
232 g_return_if_fail(priv);
233 g_return_if_fail(priv->wps);
235 gboolean wps_started = FALSE;
236 int ret = LOCATION_ERROR_NONE;
239 onoff = location_setting_get_key_val(key);
241 /* restart WPS when GPS stopped by setting */
242 g_object_get(priv->wps, "is_started", &wps_started, NULL);
243 if (wps_started == FALSE && 1 == location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED)) {
244 LOCATION_LOGD("GPS stoped by setting, so restart WPS");
245 ret = location_start(priv->wps);
246 LOC_COND_VOID(ret != LOCATION_ERROR_NONE, _E, "Fail hybrid/wps location_start : [%s]", err_msg(ret));
248 } else if (1 == onoff) {
249 LOCATION_LOGD("Hybrid GPS resumed by setting");
252 LOCATION_LOGD("Invalid Value[%d]", onoff);
258 hybrid_location_updated(GObject *obj, guint error, gpointer position, gpointer velocity, gpointer accuracy, gpointer self)
261 LocationPosition *pos = (LocationPosition *)position;
262 LocationVelocity *vel = (LocationVelocity *)velocity;
263 LocationAccuracy *acc = (LocationAccuracy *)accuracy;
265 LocationHybridPrivate *priv = GET_PRIVATE((LocationHybrid *)self);
266 g_return_if_fail(priv);
268 GType g_type = G_TYPE_FROM_INSTANCE(obj);
269 if (g_type == LOCATION_TYPE_GPS) {
271 location_cancel_single_location(priv->wps);
272 } else if (g_type == LOCATION_TYPE_WPS) {
274 location_cancel_single_location(priv->gps);
277 g_signal_emit(self, signals[LOCATION_UPDATED], 0, error, pos, vel, acc);
281 hybrid_service_updated(GObject *obj, gint type, gpointer data, gpointer velocity, gpointer accuracy, gpointer self)
284 LocationPosition *pos = NULL;
285 LocationVelocity *vel = NULL;
286 LocationAccuracy *acc = NULL;
287 LocationSatellite *sat = NULL;
288 gboolean wps_started = FALSE;
289 int ret = LOCATION_ERROR_NONE;
291 if (type == SATELLITE_UPDATED) {
292 sat = (LocationSatellite *) data;
293 if (!sat->timestamp) return;
295 pos = (LocationPosition *) data;
296 vel = (LocationVelocity *) velocity;
297 acc = (LocationAccuracy *) accuracy;
298 if (!pos->timestamp) return;
299 if (!vel->timestamp) return;
302 LocationHybridPrivate *priv = GET_PRIVATE((LocationHybrid *)self);
303 g_return_if_fail(priv);
305 GType g_type = G_TYPE_FROM_INSTANCE(obj);
306 if (g_type == LOCATION_TYPE_GPS) {
307 if (type == SATELLITE_UPDATED) {
308 satellite_signaling(self, signals, &(priv->enabled), priv->sat_interval, TRUE, &(priv->sat_updated_timestamp), &(priv->sat), sat);
310 } else if (location_setting_get_int(VCONFKEY_LOCATION_GPS_STATE) == VCONFKEY_LOCATION_GPS_SEARCHING
311 && location_setting_get_int(VCONFKEY_LOCATION_MOCK_ENABLED) == 0) {
312 LOCATION_LOGD("Searching GPS");
314 /* restart WPS when GPS not available */
315 if (priv->wps) g_object_get(priv->wps, "is_started", &wps_started, NULL);
316 if (priv->wps && wps_started == FALSE) {
317 LOCATION_LOGD("Starting WPS");
318 ret = location_start(priv->wps);
319 LOC_COND_VOID(ret != LOCATION_ERROR_NONE, _E, "Fail hyhrid location_start : [%s]", err_msg(ret));
325 if (hybrid_compare_g_type_method(priv, g_type)) {
326 if (priv->pos) location_position_free(priv->pos);
327 if (priv->vel) location_velocity_free(priv->vel);
328 if (priv->acc) location_accuracy_free(priv->acc);
330 if (pos) priv->pos = location_position_copy(pos);
331 if (vel) priv->vel = location_velocity_copy(vel);
332 if (acc) priv->acc = location_accuracy_copy(acc);
336 enable_signaling(self, signals, &(priv->enabled), TRUE, pos->status);
338 if (type == DISTANCE_UPDATED) {
339 distance_based_position_signaling(self, signals, priv->enabled, pos, vel, acc,
340 priv->min_interval, priv->min_distance, &(priv->enabled),
341 &(priv->dist_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
343 position_velocity_signaling(self, signals, priv->pos_interval, priv->vel_interval, priv->loc_interval,
344 &(priv->pos_updated_timestamp), &(priv->vel_updated_timestamp), &(priv->loc_updated_timestamp),
345 priv->boundary_list, pos, vel, acc);
349 /* if receive GPS position then stop WPS.. */
350 if (priv->wps) g_object_get(priv->wps, "is_started", &wps_started, NULL);
351 if (g_type == LOCATION_TYPE_GPS && wps_started == TRUE) {
352 LOCATION_LOGD("Calling WPS stop");
353 ret = location_stop(priv->wps);
354 LOC_COND_VOID(ret != LOCATION_ERROR_NONE, _E, "Fail hyhrid location_stop : [%s]", err_msg(ret));
357 } else if (g_type == LOCATION_TYPE_WPS && location_setting_get_int(VCONFKEY_LOCATION_GPS_STATE) == VCONFKEY_LOCATION_GPS_SEARCHING) {
358 LOCATION_LOGD("g_type is LOCATION_TYPE_WPS and GPS is searching");
359 hybrid_set_current_method(priv, g_type);
361 if (priv->pos) location_position_free(priv->pos);
362 if (priv->vel) location_velocity_free(priv->vel);
363 if (priv->acc) location_accuracy_free(priv->acc);
365 if (pos) priv->pos = location_position_copy(pos);
366 if (vel) priv->vel = location_velocity_copy(vel);
367 if (acc) priv->acc = location_accuracy_copy(acc);
371 enable_signaling(self, signals, &(priv->enabled), TRUE, pos->status);
373 if (type == DISTANCE_UPDATED) {
374 distance_based_position_signaling(self, signals, priv->enabled, pos, vel, acc,
375 priv->min_interval, priv->min_distance, &(priv->enabled),
376 &(priv->dist_updated_timestamp), &(priv->pos), &(priv->vel), &(priv->acc));
378 LOCATION_LOGD("position_velocity_signaling");
379 position_velocity_signaling(self, signals, priv->pos_interval, priv->vel_interval, priv->loc_interval,
380 &(priv->pos_updated_timestamp), &(priv->vel_updated_timestamp), &(priv->loc_updated_timestamp),
381 priv->boundary_list, pos, vel, acc);
388 hybrid_service_enabled(GObject *obj, guint status, gpointer self)
391 LocationHybridPrivate *priv = GET_PRIVATE((LocationHybrid *)self);
392 g_return_if_fail(priv);
394 GType g_type = G_TYPE_FROM_INSTANCE(obj);
395 if (g_type == LOCATION_TYPE_GPS) {
396 priv->gps_enabled = TRUE;
397 } else if (g_type == LOCATION_TYPE_WPS) {
398 priv->wps_enabled = TRUE;
400 LOCATION_LOGW("Undefined GType enabled");
403 hybrid_get_update_method(priv);
407 hybrid_service_disabled(GObject *obj, guint status, gpointer self)
410 LocationHybridPrivate *priv = GET_PRIVATE((LocationHybrid *)self);
411 g_return_if_fail(priv);
412 GType g_type = G_TYPE_FROM_INSTANCE(obj);
413 if (g_type == LOCATION_TYPE_GPS) {
414 priv->gps_enabled = FALSE;
415 } else if (g_type == LOCATION_TYPE_WPS) {
416 priv->wps_enabled = FALSE;
418 LOCATION_LOGW("Undefined GType disabled");
421 hybrid_get_update_method(priv);
422 if (!priv->gps_enabled && !priv->wps_enabled)
423 enable_signaling(self, signals, &(priv->enabled), FALSE, status);
428 location_hybrid_start(LocationHybrid *self)
432 int ret_gps = LOCATION_ERROR_NONE;
433 int ret_wps = LOCATION_ERROR_NONE;
434 gboolean gps_started = FALSE;
435 gboolean wps_started = FALSE;
437 LocationHybridPrivate *priv = GET_PRIVATE(self);
438 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
439 LOC_COND_RET(!priv->gps && !priv->wps, LOCATION_ERROR_NOT_AVAILABLE, _E, "GPS and WPS Object are not created.");
441 if (priv->gps) g_object_get(priv->gps, "is_started", &gps_started, NULL);
442 if (priv->wps) g_object_get(priv->wps, "is_started", &wps_started, NULL);
444 if ((gps_started == TRUE) || (wps_started == TRUE)) {
445 LOCATION_LOGD("Already started");
446 return LOCATION_ERROR_NONE;
449 if (priv->gps) ret_gps = location_start(priv->gps);
450 if (priv->wps) ret_wps = location_start(priv->wps);
452 if (ret_gps != LOCATION_ERROR_NONE && ret_wps != LOCATION_ERROR_NONE) {
453 LOCATION_LOGD("ret_gps = %d, ret_wps = %d", ret_gps, ret_wps);
454 if (ret_gps == LOCATION_ERROR_SECURITY_DENIED || ret_wps == LOCATION_ERROR_SECURITY_DENIED)
455 return LOCATION_ERROR_SECURITY_DENIED;
456 else if (ret_gps == LOCATION_ERROR_SETTING_OFF || ret_wps == LOCATION_ERROR_SETTING_OFF)
457 return LOCATION_ERROR_SETTING_OFF;
458 else if (ret_gps == LOCATION_ERROR_NOT_ALLOWED || ret_wps == LOCATION_ERROR_NOT_ALLOWED)
459 return LOCATION_ERROR_NOT_ALLOWED;
461 return LOCATION_ERROR_NOT_AVAILABLE;
464 if (priv->set_noti == FALSE) {
465 location_setting_add_notify(VCONFKEY_LOCATION_ENABLED, location_hybrid_gps_cb, self);
466 priv->set_noti = TRUE;
469 return LOCATION_ERROR_NONE;
473 location_hybrid_stop(LocationHybrid *self)
477 LocationHybridPrivate *priv = GET_PRIVATE(self);
478 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
480 LOCATION_LOGD("location_hybrid_stop started......!!!");
482 int ret_gps = LOCATION_ERROR_NOT_AVAILABLE;
483 int ret_wps = LOCATION_ERROR_NOT_AVAILABLE;
484 gboolean gps_started = FALSE;
485 gboolean wps_started = FALSE;
487 if (priv->gps) g_object_get(priv->gps, "is_started", &gps_started, NULL);
488 if (priv->wps) g_object_get(priv->wps, "is_started", &wps_started, NULL);
490 if ((gps_started == FALSE) && (wps_started == FALSE))
491 return LOCATION_ERROR_NONE;
493 if (priv->gps) ret_gps = location_stop(priv->gps);
494 if (priv->wps) ret_wps = location_stop(priv->wps);
496 if (ret_gps != LOCATION_ERROR_NONE && ret_wps != LOCATION_ERROR_NONE)
497 return LOCATION_ERROR_NOT_AVAILABLE;
499 if (priv->pos_timer) g_source_remove(priv->pos_timer);
500 if (priv->vel_timer) g_source_remove(priv->vel_timer);
504 if (priv->set_noti == TRUE) {
505 location_setting_ignore_notify(VCONFKEY_LOCATION_ENABLED, location_hybrid_gps_cb);
506 priv->set_noti = FALSE;
509 priv->gps_enabled = FALSE;
510 priv->wps_enabled = FALSE;
512 return LOCATION_ERROR_NONE;
516 location_hybrid_dispose(GObject *gobject)
519 LocationHybridPrivate *priv = GET_PRIVATE(gobject);
520 g_return_if_fail(priv);
522 if (priv->pos_timer) g_source_remove(priv->pos_timer);
523 if (priv->vel_timer) g_source_remove(priv->vel_timer);
527 if (priv->set_noti == TRUE) {
528 location_setting_ignore_notify(VCONFKEY_LOCATION_ENABLED, location_hybrid_gps_cb);
529 priv->set_noti = FALSE;
532 G_OBJECT_CLASS(location_hybrid_parent_class)->dispose(gobject);
536 location_hybrid_finalize(GObject *gobject)
539 LocationHybridPrivate *priv = GET_PRIVATE(gobject);
540 g_return_if_fail(priv);
543 g_signal_handlers_disconnect_by_func(priv->gps, G_CALLBACK(hybrid_service_enabled), gobject);
544 g_signal_handlers_disconnect_by_func(priv->gps, G_CALLBACK(hybrid_service_disabled), gobject);
545 g_signal_handlers_disconnect_by_func(priv->gps, G_CALLBACK(hybrid_service_updated), gobject);
546 g_signal_handlers_disconnect_by_func(priv->gps, G_CALLBACK(hybrid_location_updated), gobject);
547 location_free(priv->gps, TRUE);
550 g_signal_handlers_disconnect_by_func(priv->wps, G_CALLBACK(hybrid_service_enabled), gobject);
551 g_signal_handlers_disconnect_by_func(priv->wps, G_CALLBACK(hybrid_service_disabled), gobject);
552 g_signal_handlers_disconnect_by_func(priv->wps, G_CALLBACK(hybrid_service_updated), gobject);
553 g_signal_handlers_disconnect_by_func(priv->wps, G_CALLBACK(hybrid_location_updated), gobject);
554 location_free(priv->wps, TRUE);
557 if (priv->boundary_list) {
558 g_list_free_full(priv->boundary_list, free_boundary_list);
559 priv->boundary_list = NULL;
563 location_position_free(priv->pos);
568 location_velocity_free(priv->vel);
573 location_accuracy_free(priv->acc);
578 location_satellite_free(priv->sat);
582 G_OBJECT_CLASS(location_hybrid_parent_class)->finalize(gobject);
586 location_hybrid_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
588 LocationHybridPrivate *priv = GET_PRIVATE(object);
589 g_return_if_fail(priv);
590 if (!priv->gps && !priv->wps) {
591 LOCATION_LOGW("Set property is not available now");
596 switch (property_id) {
597 case PROP_BOUNDARY: {
598 GList *boundary_list = (GList *)g_list_copy(g_value_get_pointer(value));
599 ret = set_prop_boundary(&priv->boundary_list, boundary_list);
600 LOC_COND_VOID(ret != LOCATION_ERROR_NONE, _E, "Set boundary. Error[%s]", err_msg(ret));
603 case PROP_REMOVAL_BOUNDARY: {
604 LocationBoundary *req_boundary = (LocationBoundary *) g_value_dup_boxed(value);
605 ret = set_prop_removal_boundary(&priv->boundary_list, req_boundary);
606 LOC_COND_VOID(ret != LOCATION_ERROR_NONE, _E, "Removal boundary. Error[%s]", err_msg(ret));
609 case PROP_POS_INTERVAL: {
610 guint interval = g_value_get_uint(value);
611 LOCATION_LOGD("Set prop>> PROP_POS_INTERVAL: %u", interval);
613 if (interval < LOCATION_UPDATE_INTERVAL_MAX)
614 priv->pos_interval = interval;
616 priv->pos_interval = (guint) LOCATION_UPDATE_INTERVAL_MAX;
618 priv->pos_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
621 if (priv->pos_timer) {
622 g_source_remove(priv->pos_timer);
623 priv->pos_timer = g_timeout_add(priv->pos_interval * 1000, _position_timeout_cb, object);
626 if (priv->gps) g_object_set(priv->gps, "pos-interval", priv->pos_interval, NULL);
627 if (priv->wps) g_object_set(priv->wps, "pos-interval", priv->pos_interval, NULL);
631 case PROP_VEL_INTERVAL: {
632 guint interval = g_value_get_uint(value);
633 LOCATION_LOGD("Set prop>> PROP_VEL_INTERVAL: %u", interval);
635 if (interval < LOCATION_UPDATE_INTERVAL_MAX)
636 priv->vel_interval = interval;
638 priv->vel_interval = (guint) LOCATION_UPDATE_INTERVAL_MAX;
641 priv->vel_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
643 if (priv->vel_timer) {
644 g_source_remove(priv->vel_timer);
645 priv->vel_timer = g_timeout_add(priv->vel_interval * 1000, _velocity_timeout_cb, object);
648 if (priv->gps) g_object_set(priv->gps, "vel-interval", priv->vel_interval, NULL);
649 if (priv->wps) g_object_set(priv->wps, "vel-interval", priv->vel_interval, NULL);
653 case PROP_SAT_INTERVAL: {
654 guint interval = g_value_get_uint(value);
655 LOCATION_LOGD("Set prop>> PROP_SAT_INTERVAL: %u", interval);
657 if (interval < LOCATION_UPDATE_INTERVAL_MAX)
658 priv->sat_interval = interval;
660 priv->sat_interval = (guint) LOCATION_UPDATE_INTERVAL_MAX;
663 priv->sat_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
667 case PROP_LOC_INTERVAL: {
668 guint interval = g_value_get_uint(value);
669 LOCATION_LOGD("Set prop>> PROP_LOC_INTERVAL: %u", interval);
671 if (interval < LOCATION_UPDATE_INTERVAL_MAX)
672 priv->loc_interval = interval;
674 priv->loc_interval = (guint)LOCATION_UPDATE_INTERVAL_MAX;
676 priv->loc_interval = (guint)LOCATION_UPDATE_INTERVAL_DEFAULT;
678 if (priv->gps) g_object_set(priv->gps, "loc-interval", priv->loc_interval, NULL);
679 if (priv->wps) g_object_set(priv->wps, "loc-interval", priv->loc_interval, NULL);
683 case PROP_MIN_INTERVAL: {
684 guint interval = g_value_get_uint(value);
685 LOCATION_LOGD("Set prop>> PROP_MIN_INTERVAL: %u", interval);
687 if (interval < LOCATION_MIN_INTERVAL_MAX)
688 priv->min_interval = interval;
690 priv->min_interval = (guint)LOCATION_MIN_INTERVAL_MAX;
692 priv->min_interval = (guint)LOCATION_MIN_INTERVAL_DEFAULT;
694 if (priv->gps) g_object_set(priv->gps, "min-interval", priv->min_interval, NULL);
695 if (priv->wps) g_object_set(priv->wps, "min-interval", priv->min_interval, NULL);
699 case PROP_MIN_DISTANCE: {
700 gdouble distance = g_value_get_double(value);
701 LOCATION_LOGD("Set prop>> PROP_MIN_DISTANCE: %f", distance);
703 if (distance < LOCATION_MIN_DISTANCE_MAX)
704 priv->min_distance = distance;
706 priv->min_distance = (gdouble)LOCATION_MIN_DISTANCE_MAX;
708 priv->min_distance = (gdouble)LOCATION_MIN_DISTANCE_DEFAULT;
710 if (priv->gps) g_object_set(priv->gps, "min-distance", priv->min_distance, NULL);
711 if (priv->wps) g_object_set(priv->wps, "min-distance", priv->min_distance, NULL);
716 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
722 location_hybrid_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
724 LocationHybridPrivate *priv = GET_PRIVATE(object);
725 g_return_if_fail(priv);
727 LOC_COND_VOID(!priv->gps && !priv->wps, _E, "Error : Get property is not available now");
729 LOCATION_LOGW("Get Propery ID[%d]", property_id);
731 switch (property_id) {
732 case PROP_METHOD_TYPE:
733 g_value_set_int(value, hybrid_get_current_method(priv));
735 case PROP_LAST_POSITION:
736 g_value_set_boxed(value, priv->pos);
739 g_value_set_pointer(value, g_list_first(priv->boundary_list));
741 case PROP_POS_INTERVAL:
742 g_value_set_uint(value, priv->pos_interval);
744 case PROP_VEL_INTERVAL:
745 g_value_set_uint(value, priv->vel_interval);
747 case PROP_SAT_INTERVAL:
748 g_value_set_uint(value, priv->sat_interval);
750 case PROP_LOC_INTERVAL:
751 g_value_set_uint(value, priv->loc_interval);
753 case PROP_MIN_INTERVAL:
754 g_value_set_uint(value, priv->min_interval);
756 case PROP_MIN_DISTANCE:
757 g_value_set_double(value, priv->min_distance);
759 case PROP_SERVICE_STATUS:
760 g_value_set_int(value, priv->enabled);
763 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
769 location_hybrid_get_position(LocationHybrid *self, LocationPosition **position, LocationAccuracy **accuracy)
772 int ret = LOCATION_ERROR_NOT_AVAILABLE;
773 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED) && !location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED))
774 return LOCATION_ERROR_SETTING_OFF;
776 LocationHybridPrivate *priv = GET_PRIVATE(self);
777 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
778 LOCATION_IF_HYBRID_FAIL(VCONFKEY_LOCATION_GPS_STATE, VCONFKEY_LOCATION_WPS_STATE);
781 *position = location_position_copy(priv->pos);
782 ret = LOCATION_ERROR_NONE;
786 *accuracy = location_accuracy_copy(priv->acc);
792 location_hybrid_get_position_ext(LocationHybrid *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
795 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED) && !location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED))
796 return LOCATION_ERROR_SETTING_OFF;
798 LocationHybridPrivate *priv = GET_PRIVATE(self);
799 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
800 LOCATION_IF_HYBRID_FAIL(VCONFKEY_LOCATION_GPS_STATE, VCONFKEY_LOCATION_WPS_STATE);
802 if (priv->pos && priv->vel) {
803 *position = location_position_copy(priv->pos);
804 *velocity = location_velocity_copy(priv->vel);
806 LOCATION_LOGE("There is invalid data.");
807 return LOCATION_ERROR_NOT_AVAILABLE;
811 *accuracy = location_accuracy_copy(priv->acc);
813 *accuracy = location_accuracy_new(LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
815 return LOCATION_ERROR_NONE;
820 location_hybrid_get_last_position(LocationHybrid *self, LocationPosition **position, LocationAccuracy **accuracy)
824 int ret = LOCATION_ERROR_NONE;
825 LocationPosition *gps_pos = NULL, *wps_pos = NULL;
826 LocationAccuracy *gps_acc = NULL, *wps_acc = NULL;
827 LocationHybridPrivate *priv = GET_PRIVATE(self);
828 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
830 if (priv->gps) location_get_last_position(priv->gps, &gps_pos, &gps_acc);
831 if (priv->wps) location_get_last_position(priv->wps, &wps_pos, &wps_acc);
833 if (gps_pos && wps_pos) {
834 if (wps_pos->timestamp > gps_pos->timestamp) {
837 location_position_free(gps_pos);
838 location_accuracy_free(gps_acc);
842 location_position_free(wps_pos);
843 location_accuracy_free(wps_acc);
845 } else if (gps_pos) {
848 } else if (wps_pos) {
852 ret = LOCATION_ERROR_NOT_AVAILABLE;
859 location_hybrid_get_last_position_ext(LocationHybrid *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy)
863 int ret = LOCATION_ERROR_NONE;
864 LocationPosition *gps_pos = NULL, *wps_pos = NULL;
865 LocationVelocity *gps_vel = NULL, *wps_vel = NULL;
866 LocationAccuracy *gps_acc = NULL, *wps_acc = NULL;
867 LocationHybridPrivate *priv = GET_PRIVATE(self);
868 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
870 if (priv->gps) location_get_last_position_ext(priv->gps, &gps_pos, &gps_vel, &gps_acc);
871 if (priv->wps) location_get_last_position_ext(priv->wps, &wps_pos, &wps_vel, &wps_acc);
873 if (gps_pos && wps_pos && gps_vel && wps_vel) {
874 if (wps_pos->timestamp > gps_pos->timestamp) {
878 location_position_free(gps_pos);
879 location_velocity_free(gps_vel);
880 location_accuracy_free(gps_acc);
885 location_position_free(wps_pos);
886 location_velocity_free(wps_vel);
887 location_accuracy_free(wps_acc);
889 } else if (gps_pos && gps_vel) {
893 } else if (wps_pos && wps_vel) {
898 ret = LOCATION_ERROR_NOT_AVAILABLE;
905 location_hybrid_get_velocity(LocationHybrid *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
908 int ret = LOCATION_ERROR_NOT_AVAILABLE;
909 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED) && !location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED))
910 return LOCATION_ERROR_SETTING_OFF;
912 LocationHybridPrivate *priv = GET_PRIVATE(self);
913 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
914 LOCATION_IF_HYBRID_FAIL(VCONFKEY_LOCATION_GPS_STATE, VCONFKEY_LOCATION_WPS_STATE);
917 *velocity = location_velocity_copy(priv->vel);
918 ret = LOCATION_ERROR_NONE;
922 *accuracy = location_accuracy_copy(priv->acc);
928 location_hybrid_get_last_velocity(LocationHybrid *self, LocationVelocity **velocity, LocationAccuracy **accuracy)
932 int ret = LOCATION_ERROR_NONE;
933 LocationHybridPrivate *priv = GET_PRIVATE(self);
934 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
935 LocationVelocity *gps_vel = NULL, *wps_vel = NULL;
936 LocationAccuracy *gps_acc = NULL, *wps_acc = NULL;
938 if (priv->gps) location_get_last_velocity(priv->gps, &gps_vel, &gps_acc);
939 if (priv->wps) location_get_last_velocity(priv->wps, &wps_vel, &wps_acc);
941 if (gps_vel && wps_vel) {
942 if (wps_vel->timestamp > gps_vel->timestamp) {
945 location_velocity_free(gps_vel);
946 location_accuracy_free(gps_acc);
950 location_velocity_free(wps_vel);
951 location_accuracy_free(wps_acc);
953 } else if (gps_vel) {
956 } else if (wps_vel) {
962 ret = LOCATION_ERROR_NOT_AVAILABLE;
969 location_hybrid_get_satellite(LocationHybrid *self, LocationSatellite **satellite)
972 int ret = LOCATION_ERROR_NOT_AVAILABLE;
973 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED) && !location_setting_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED))
974 return LOCATION_ERROR_SETTING_OFF;
976 LocationHybridPrivate *priv = GET_PRIVATE(self);
977 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
979 *satellite = location_satellite_copy(priv->sat);
980 ret = LOCATION_ERROR_NONE;
987 location_hybrid_get_last_satellite(LocationHybrid *self, LocationSatellite **satellite)
991 int ret = LOCATION_ERROR_NONE;
992 LocationHybridPrivate *priv = GET_PRIVATE(self);
993 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
996 ret = location_get_last_satellite(priv->gps, satellite);
999 ret = LOCATION_ERROR_NOT_AVAILABLE;
1006 location_hybrid_set_option(LocationHybrid *self, const char *option)
1009 LocationHybridPrivate *priv = GET_PRIVATE(self);
1010 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
1012 int ret_gps = LOCATION_ERROR_NOT_AVAILABLE;
1013 int ret_wps = LOCATION_ERROR_NOT_AVAILABLE;
1015 if (priv->gps) ret_gps = location_set_option(priv->gps, option);
1016 if (priv->wps) ret_wps = location_set_option(priv->wps, option);
1018 if (ret_gps != LOCATION_ERROR_NONE && ret_wps != LOCATION_ERROR_NONE)
1019 return LOCATION_ERROR_NOT_AVAILABLE;
1021 return LOCATION_ERROR_NONE;
1025 location_hybrid_request_single_location(LocationHybrid *self, int timeout)
1028 LocationHybridPrivate *priv = GET_PRIVATE(self);
1029 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
1031 int ret = LOCATION_ERROR_NOT_AVAILABLE;
1032 int ret_gps = LOCATION_ERROR_NOT_AVAILABLE;
1033 int ret_wps = LOCATION_ERROR_NOT_AVAILABLE;
1035 ret = __get_availability_use_location(self);
1036 LOC_IF_FAIL(ret, _E, "setting off [%s]", err_msg(LOCATION_ERROR_SETTING_OFF));
1039 LOCATION_LOGD("location_request_single_location : gps");
1040 ret_gps = location_request_single_location(priv->gps, timeout);
1044 LOCATION_LOGD("location_request_single_location : wps");
1045 ret_wps = location_request_single_location(priv->wps, timeout);
1048 if (ret_gps != LOCATION_ERROR_NONE && ret_wps != LOCATION_ERROR_NONE) {
1049 if (ret_gps == LOCATION_ERROR_NOT_ALLOWED && ret_wps == LOCATION_ERROR_NOT_ALLOWED)
1050 return LOCATION_ERROR_NOT_ALLOWED;
1052 return LOCATION_ERROR_NOT_AVAILABLE;
1059 location_hybrid_cancel_single_location(LocationHybrid *self, int timeout)
1062 return LOCATION_ERROR_NOT_SUPPORTED;
1067 location_hybrid_get_nmea(LocationHybrid *self, char **nmea_data)
1070 LocationHybridPrivate *priv = GET_PRIVATE(self);
1071 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
1073 int ret = LOCATION_ERROR_NOT_AVAILABLE;
1075 if (priv->gps) ret = location_get_nmea(priv->gps, nmea_data);
1077 if (ret != LOCATION_ERROR_NONE)
1078 return LOCATION_ERROR_NOT_AVAILABLE;
1080 return LOCATION_ERROR_NONE;
1084 location_hybrid_set_mock_location(LocationHybrid *self, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy)
1087 LocationHybridPrivate *priv = GET_PRIVATE(self);
1088 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
1089 int ret = LOCATION_ERROR_NONE;
1092 ret = location_set_mock_location(priv->gps, position, velocity, accuracy);
1094 ret = location_set_mock_location(priv->wps, position, velocity, accuracy);
1096 ret = LOCATION_ERROR_NOT_AVAILABLE;
1102 location_hybrid_clear_mock_location(LocationHybrid *self)
1105 LocationHybridPrivate *priv = GET_PRIVATE(self);
1106 g_return_val_if_fail(priv, LOCATION_ERROR_NOT_AVAILABLE);
1107 int ret = LOCATION_ERROR_NONE;
1110 ret = location_clear_mock_location(priv->gps);
1112 ret = location_clear_mock_location(priv->wps);
1114 ret = LOCATION_ERROR_NOT_AVAILABLE;
1120 location_ielement_interface_init(LocationIElementInterface *iface)
1122 iface->start = (TYPE_START_FUNC)location_hybrid_start;
1123 iface->stop = (TYPE_STOP_FUNC)location_hybrid_stop;
1124 iface->get_position = (TYPE_GET_POSITION)location_hybrid_get_position;
1125 iface->get_position_ext = (TYPE_GET_POSITION_EXT)location_hybrid_get_position_ext;
1126 iface->get_last_position = (TYPE_GET_POSITION)location_hybrid_get_last_position;
1127 iface->get_last_position_ext = (TYPE_GET_POSITION_EXT)location_hybrid_get_last_position_ext;
1128 iface->get_velocity = (TYPE_GET_VELOCITY)location_hybrid_get_velocity;
1129 iface->get_last_velocity = (TYPE_GET_VELOCITY)location_hybrid_get_last_velocity;
1130 iface->get_satellite = (TYPE_GET_SATELLITE)location_hybrid_get_satellite;
1131 iface->get_last_satellite = (TYPE_GET_SATELLITE)location_hybrid_get_last_satellite;
1132 iface->set_option = (TYPE_SET_OPTION)location_hybrid_set_option;
1133 iface->request_single_location = (TYPE_REQUEST_SINGLE_LOCATION)location_hybrid_request_single_location;
1134 iface->cancel_single_location = (TYPE_CANCEL_SINGLE_LOCATION)location_hybrid_cancel_single_location;
1135 iface->get_nmea = (TYPE_GET_NMEA)location_hybrid_get_nmea;
1137 iface->set_mock_location = (TYPE_SET_MOCK_LOCATION) location_hybrid_set_mock_location;
1138 iface->clear_mock_location = (TYPE_CLEAR_MOCK_LOCATION) location_hybrid_clear_mock_location;
1142 location_hybrid_init(LocationHybrid *self)
1145 LocationHybridPrivate *priv = GET_PRIVATE(self);
1146 g_return_if_fail(priv);
1148 priv->pos_interval = LOCATION_UPDATE_INTERVAL_NONE;
1149 priv->vel_interval = LOCATION_UPDATE_INTERVAL_NONE;
1150 priv->sat_interval = LOCATION_UPDATE_INTERVAL_NONE;
1151 priv->loc_interval = LOCATION_UPDATE_INTERVAL_NONE;
1152 priv->min_interval = LOCATION_UPDATE_INTERVAL_NONE;
1154 priv->pos_updated_timestamp = 0;
1155 priv->vel_updated_timestamp = 0;
1156 priv->sat_updated_timestamp = 0;
1157 priv->loc_updated_timestamp = 0;
1159 priv->gps_enabled = FALSE;
1160 priv->wps_enabled = FALSE;
1164 priv->set_noti = FALSE;
1165 priv->signal_type = 0;
1166 priv->pos_timer = 0;
1167 priv->vel_timer = 0;
1169 if (location_is_supported_method(LOCATION_METHOD_GPS)) priv->gps = location_new(LOCATION_METHOD_GPS, TRUE);
1170 if (location_is_supported_method(LOCATION_METHOD_WPS)) priv->wps = location_new(LOCATION_METHOD_WPS, TRUE);
1173 g_signal_connect(priv->gps, "service-enabled", G_CALLBACK(hybrid_service_enabled), self);
1174 g_signal_connect(priv->gps, "service-disabled", G_CALLBACK(hybrid_service_disabled), self);
1175 g_signal_connect(priv->gps, "service-updated", G_CALLBACK(hybrid_service_updated), self);
1176 g_signal_connect(priv->gps, "location-updated", G_CALLBACK(hybrid_location_updated), self);
1179 g_signal_connect(priv->wps, "service-enabled", G_CALLBACK(hybrid_service_enabled), self);
1180 g_signal_connect(priv->wps, "service-disabled", G_CALLBACK(hybrid_service_disabled), self);
1181 g_signal_connect(priv->wps, "service-updated", G_CALLBACK(hybrid_service_updated), self);
1182 g_signal_connect(priv->wps, "location-updated", G_CALLBACK(hybrid_location_updated), self);
1185 hybrid_set_current_method(priv, LOCATION_TYPE_HYBRID);
1186 priv->enabled = FALSE;
1193 priv->boundary_list = NULL;
1197 location_hybrid_class_init(LocationHybridClass *klass)
1200 GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
1202 gobject_class->set_property = location_hybrid_set_property;
1203 gobject_class->get_property = location_hybrid_get_property;
1205 gobject_class->dispose = location_hybrid_dispose;
1206 gobject_class->finalize = location_hybrid_finalize;
1208 g_type_class_add_private(klass, sizeof(LocationHybridPrivate));
1210 signals[SERVICE_ENABLED] =
1211 g_signal_new("service-enabled", G_TYPE_FROM_CLASS(klass),
1212 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1213 G_STRUCT_OFFSET(LocationHybridClass, enabled),
1214 NULL, NULL, location_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
1216 signals[SERVICE_DISABLED] =
1217 g_signal_new("service-disabled", G_TYPE_FROM_CLASS(klass),
1218 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1219 G_STRUCT_OFFSET(LocationHybridClass, disabled),
1220 NULL, NULL, location_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
1222 signals[SERVICE_UPDATED] =
1223 g_signal_new("service-updated", G_TYPE_FROM_CLASS(klass),
1224 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1225 G_STRUCT_OFFSET(LocationHybridClass, service_updated),
1226 NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER,
1227 G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1229 signals[LOCATION_UPDATED] =
1230 g_signal_new("location-updated", G_TYPE_FROM_CLASS(klass),
1231 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1232 G_STRUCT_OFFSET(LocationHybridClass, location_updated),
1233 NULL, NULL, location_VOID__INT_POINTER_POINTER_POINTER,
1234 G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1237 g_signal_new("zone-in", G_TYPE_FROM_CLASS(klass),
1238 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1239 G_STRUCT_OFFSET(LocationHybridClass, zone_in),
1240 NULL, NULL, location_VOID__POINTER_POINTER_POINTER,
1241 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1244 g_signal_new("zone-out", G_TYPE_FROM_CLASS(klass),
1245 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
1246 G_STRUCT_OFFSET(LocationHybridClass, zone_out),
1247 NULL, NULL, location_VOID__POINTER_POINTER_POINTER,
1248 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
1250 properties[PROP_METHOD_TYPE] =
1251 g_param_spec_int("method", "method type",
1252 "location method type name", LOCATION_METHOD_HYBRID,
1253 LOCATION_METHOD_HYBRID, LOCATION_METHOD_HYBRID, G_PARAM_READABLE);
1255 properties[PROP_LAST_POSITION] =
1256 g_param_spec_boxed("last-position", "hybrid last position prop",
1257 "hybrid last position data", LOCATION_TYPE_POSITION, G_PARAM_READABLE);
1259 properties[PROP_POS_INTERVAL] =
1260 g_param_spec_uint("pos-interval", "position interval prop",
1261 "position interval data", LOCATION_UPDATE_INTERVAL_MIN,
1262 LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
1264 properties[PROP_VEL_INTERVAL] =
1265 g_param_spec_uint("vel-interval", "velocity interval prop",
1266 "velocity interval data", LOCATION_UPDATE_INTERVAL_MIN,
1267 LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
1269 properties[PROP_SAT_INTERVAL] =
1270 g_param_spec_uint("sat-interval", "satellite interval prop",
1271 "satellite interval data", LOCATION_UPDATE_INTERVAL_MIN,
1272 LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
1274 properties[PROP_LOC_INTERVAL] =
1275 g_param_spec_uint("loc-interval", "gps location interval prop",
1276 "gps location interval data", LOCATION_UPDATE_INTERVAL_MIN,
1277 LOCATION_UPDATE_INTERVAL_MAX, LOCATION_UPDATE_INTERVAL_DEFAULT, G_PARAM_READWRITE);
1279 properties[PROP_MIN_INTERVAL] =
1280 g_param_spec_uint("min-interval", "gps distance-based interval prop",
1281 "gps distance-based interval data", LOCATION_MIN_INTERVAL_MIN,
1282 LOCATION_MIN_INTERVAL_MAX, LOCATION_MIN_INTERVAL_DEFAULT, G_PARAM_READWRITE);
1284 properties[PROP_MIN_DISTANCE] =
1285 g_param_spec_double("min-distance", "gps distance-based distance prop",
1286 "gps distance-based distance data", LOCATION_MIN_DISTANCE_MIN,
1287 LOCATION_MIN_DISTANCE_MAX, LOCATION_MIN_DISTANCE_DEFAULT, G_PARAM_READWRITE);
1289 properties[PROP_BOUNDARY] =
1290 g_param_spec_pointer("boundary", "hybrid boundary prop",
1291 "hybrid boundary data", G_PARAM_READWRITE);
1293 properties[PROP_REMOVAL_BOUNDARY] =
1294 g_param_spec_boxed("removal-boundary", "hybrid removal boundary prop",
1295 "hybrid removal boundary data", LOCATION_TYPE_BOUNDARY, G_PARAM_READWRITE);
1298 properties[PROP_SERVICE_STATUS] =
1299 g_param_spec_int("service-status", "location service status prop",
1300 "location service status data", LOCATION_STATUS_NO_FIX,
1301 LOCATION_STATUS_3D_FIX, LOCATION_STATUS_NO_FIX, G_PARAM_READABLE);
1303 g_object_class_install_properties(gobject_class, PROP_MAX, properties);