Fix distance callback 81/101681/1 accepted/tizen/common/20161202.233320 accepted/tizen/ivi/20161205.000217 accepted/tizen/mobile/20161205.000114 accepted/tizen/tv/20161205.000126 accepted/tizen/wearable/20161205.000138 submit/tizen/20161202.055356
authorkj7.sung <kj7.sung@samsung.com>
Fri, 2 Dec 2016 03:03:22 +0000 (12:03 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Fri, 2 Dec 2016 03:03:22 +0000 (12:03 +0900)
Change-Id: I27566660cc770e697c1b130433f2b66f4b2d79fc
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
packaging/capi-location-manager.changes
packaging/capi-location-manager.spec
src/locations.c
test/CMakeLists.txt
test/capi-location-manager-test.xml
test/location_test.c

index 77b2ac3..2a85062 100644 (file)
@@ -1,3 +1,9 @@
+[Version]      capi-location-manager_0.7.6
+[Date]         2 Dec 2016
+[Title]                Fix distance based callback
+[Developer]    Kyoungjun Sung <kj7.sung@samsung.com>
+
+================================================================================
 [Version]      capi-location-manager_0.7.5
 [Date]         28 Oct 2016
 [Title]                Dynamic interval table for multi handle
index 2c26358..4bb8433 100644 (file)
@@ -1,6 +1,6 @@
 Name: capi-location-manager
 Summary: A Location Manager library in Tizen Native API
-Version: 0.7.5
+Version: 0.7.6
 Release: 1
 Group: Location/API
 License: Apache-2.0
@@ -41,7 +41,7 @@ export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
--DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} -DTZ_SYS_RW_APP=%{TZ_SYS_RW_APP} \
+-DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} -DTZ_SYS_SHARE=%{TZ_SYS_SHARE} \
 
 make %{?jobs:-j%jobs}
 
@@ -79,5 +79,5 @@ Test application of Location Manager
 %files test
 %manifest test/capi-location-manager-test.manifest
 %{TZ_SYS_RO_PACKAGES}/capi-location-manager-test.xml
-%{TZ_SYS_RW_APP}/test/location/location_test
+%{TZ_SYS_SHARE}/location/location_test
 %endif
index ef839e5..1efd9b0 100755 (executable)
@@ -80,9 +80,10 @@ static void __cb_service_updated(GObject *self, guint type, gpointer data, gpoin
                                                                                        sat->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_SATELLITE]);
        } else if (type == DISTANCE_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE]) {
                LocationPosition *pos = (LocationPosition *) data;
-               LocationVelocity *vel = (LocationVelocity *) velocity;  /* current velocity */
-               ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE])(0, pos->latitude, pos->longitude, pos->altitude,
-                                                               vel->speed, vel->direction, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_DISTANCE]);
+               LocationVelocity *vel = (LocationVelocity *) velocity;
+               LocationAccuracy *acc = (LocationAccuracy *) accuracy;
+               ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE])(pos->latitude, pos->longitude, pos->altitude,
+                                                               vel->speed, vel->direction, acc->horizontal_accuracy, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_DISTANCE]);
        } else {
 
                if (handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION] && (type & POSITION_UPDATED) != 0) {
@@ -151,26 +152,6 @@ static void __cb_service_disabled(GObject *self, guint status, gpointer userdata
        }
 }
 
-#if 0
-static void __cb_service_status_changed(GObject *self, guint status, gpointer userdata)
-{
-       LOCATIONS_LOGD("Invoked. status = %u", status);
-       location_manager_s *handle = (location_manager_s *) userdata;
-
-       if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
-               if (status == LOCATION_STATUS_2D_FIX || status == LOCATION_STATUS_3D_FIX)
-                       ((location_service_state_changed_cb)
-                        handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_ENABLED, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-               else if (status == LOCATION_STATUS_NO_FIX)
-                       ((location_service_state_changed_cb)
-                                handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_DISABLED, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-               else if (status == LOCATION_STATUS_MOCK_FAIL)
-                       ((location_service_state_changed_cb)
-                                handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_ERROR, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-       }
-}
-#endif
-
 static int __compare_position(gconstpointer a, gconstpointer b)
 {
        if (location_position_equal((LocationPosition *) a, (LocationPosition *)b) == TRUE)
@@ -560,13 +541,6 @@ EXPORT_API int location_manager_destroy(location_manager_h manager)
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED] = 0;
        }
 
-#if 0
-       if (handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED]) {
-               g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED]);
-               handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED] = 0;
-       }
-#endif
-
        if (handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED]) {
                g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED]);
                handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED] = 0;
index 6f1e359..a442ad9 100644 (file)
@@ -17,5 +17,5 @@ FOREACH(src ${sources})
        TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS})
 ENDFOREACH()
 
-INSTALL(TARGETS ${src_name} DESTINATION ${TZ_SYS_RW_APP}/test/location/)
+INSTALL(TARGETS ${src_name} DESTINATION ${TZ_SYS_SHARE}/location/)
 INSTALL(FILES ${fw_test}.xml DESTINATION ${TZ_SYS_RO_PACKAGES}/)
index c1ed32e..17d722d 100644 (file)
@@ -8,7 +8,7 @@
                <privilege>http://tizen.org/privilege/location</privilege>
                <privilege>http://tizen.org/privilege/location.enable</privilege>
        </privileges>
-       <ui-application appid="capi-location-manager-test" exec=${TZ_SYS_RW_APP}"/test/location/location-test" nodisplay="true" multiple="false" type="capp" taskmanage="false" launch_mode="single">
+       <ui-application appid="capi-location-manager-test" exec=${TZ_SYS_SHARE}"/location/location-test" nodisplay="true" multiple="false" type="capp" taskmanage="false" launch_mode="single">
                <label>Location Manager Test</label>
        </ui-application>
 </manifest>
index 2a901ff..75d69c7 100755 (executable)
@@ -368,10 +368,12 @@ static void _setting_cb(location_method_e method, bool enable, void *user_data)
 
 void _satellite_updated_cb(int num_of_active, int num_of_inview, time_t timestamp, void *user_data)
 {
-       fprintf(stderr, "-------------------------- satellite updated --------------------------\n");
-       fprintf(stderr, "num_of_active[%d] num_of_inview[%d] timestamp[%ld]\n", num_of_active, num_of_inview, timestamp);
+/*     fprintf(stderr, "-------------------------- satellite updated --------------------------\n"); */
+       fprintf(stderr, "--- num_of_active[%d] num_of_inview[%d] timestamp[%ld]\n", num_of_active, num_of_inview, timestamp);
 
-       test_timer = g_timeout_add_seconds(1, wait_test, NULL);
+       repeat_count++;
+       if (repeat_count > 60)
+               test_timer = g_timeout_add_seconds(1, wait_test, NULL);
 }
 
 static void print_location_status()
@@ -495,11 +497,11 @@ static int location_test()
                        fprintf(stderr, "gps_status_set_satellite_updated_cb: %d\n", ret);
                }
                break;
-               }
+       }
        case 4:
        case 5:
        case 6: {
-               int timeout = 30;
+               int timeout = 60;
 
                fprintf(stderr, "\n     Input timeout ==> ");
                ret = scanf("%d", &timeout);
@@ -509,7 +511,7 @@ static int location_test()
                ret = location_manager_request_single_location(manager, timeout, _location_cb, manager);
                fprintf(stderr, "request single_location (method: %d): %d\n", method, ret);
                break;
-               }
+       }
        case 11:
        case 12:
        case 13: {