Fix distance callback 82/101682/1 accepted/tizen/3.0/common/20161205.091721 accepted/tizen/3.0/ivi/20161204.234045 accepted/tizen/3.0/mobile/20161204.233950 accepted/tizen/3.0/tv/20161204.234004 accepted/tizen/3.0/wearable/20161204.234023 submit/tizen_3.0/20161202.055734
authorkj7.sung <kj7.sung@samsung.com>
Fri, 2 Dec 2016 03:05:49 +0000 (12:05 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Fri, 2 Dec 2016 03:05:49 +0000 (12:05 +0900)
Change-Id: If6e2a664cd53474428b78dabc6d533bec58b9ee1
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 77b2ac3a6fcc7a037a5d88ae912abdfe5e8bcde8..2a850625611102058b89204498b17c02c7104ffe 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 2c263582c3305d54ba80e8d5b580c5b23657b96b..4bb84333cd8fa852353218f0eb04f6f0e9cccdac 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 ef839e535a7c7b413db143913584f881b59c3703..1efd9b033ac478823da7ea50b10ce9eb75fa23c0 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 6f1e35955ca36106c7c2d4d21b56d11f8c0ec4b5..a442ad90a43d5032c6c1e9bcd6d99828a2346e72 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 c1ed32ea81f78f13e75efe476e02b31a12f57cf4..17d722d714c052fb958787bc67b571e45d3322d3 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 2a901ffc4b512141bc6b14d01179581ae43efe04..75d69c7dcbd2550b87dfaf174b019bd2d6b46929 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: {