Bug 101357 - time threshold should be in microseconds
Summary: time threshold should be in microseconds
Status: RESOLVED FIXED
Alias: None
Product: GeoClue
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Geoclue Bugs
QA Contact: Geoclue Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-08 20:44 UTC by Valentin Blot
Modified: 2017-06-09 12:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
This patch solves the bug (1.04 KB, patch)
2017-06-08 21:00 UTC, Valentin Blot
Details | Splinter Review

Description Valentin Blot 2017-06-08 20:44:29 UTC
In gclue-location.c, commit d3893e6fac09064682e880c7972f2fcf82a6fb87 introduced a constant TIME_DIFF_THRESHOLD with value 60. In the summary of the commit this is said to be 60s, however it is compared to the output of g_date_time_difference, which is in microseconds. Therefore, if we want the threshold to correspond to 1 minute, TIME_DIFF_THRESHOLD should have value 60000000.
Comment 1 Valentin Blot 2017-06-08 21:00:18 UTC
Created attachment 131817 [details] [review]
This patch solves the bug
Comment 2 Zeeshan Ali 2017-06-09 10:18:43 UTC
Oooh, good catch! Thanks.
Comment 3 Zeeshan Ali 2017-06-09 10:23:39 UTC
Comment on attachment 131817 [details] [review]
This patch solves the bug

Patch applied with minor changes.
Comment 4 Valentin Blot 2017-06-09 11:39:39 UTC
Thanks. On my laptop the gps receiver is always a few seconds ahead so the positions were reported as one day old and it made gnome-maps use the less accurate wifi-based location instead. I found the bug after digging on that problem. Hopefully my gnome-maps will use gps, now!
Comment 5 Zeeshan Ali 2017-06-09 12:21:00 UTC
(In reply to Valentin Blot from comment #4)
> Thanks. On my laptop the gps receiver is always a few seconds ahead so the
> positions were reported as one day old and it made gnome-maps use the less
> accurate wifi-based location instead. I found the bug after digging on that
> problem. Hopefully my gnome-maps will use gps, now!

Cool, this probably also explains the times when maps won't pick up my location updates. Is this a standalone GPS device and are you using gps-share?
Comment 6 Valentin Blot 2017-06-09 12:27:35 UTC
No, this is a 3G modem with integrated GPS (modem is sierra gobi 3000, default modem on thinkpad X230), and I'm not using gps-share.
Comment 7 Zeeshan Ali 2017-06-09 12:42:44 UTC
(In reply to Valentin Blot from comment #6)
> No, this is a 3G modem with integrated GPS (modem is sierra gobi 3000,
> default modem on thinkpad X230), and I'm not using gps-share.

Ah OK, thanks. :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.