Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ignoring time interval on DefaultLocationProvider #118

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

yayaa
Copy link
Owner

@yayaa yayaa commented Jan 3, 2021

Fixes #116

if (getConfiguration().keepTracking()) {
requestUpdateLocation(getConfiguration().defaultProviderConfiguration().requiredTimeInterval(),
getConfiguration().defaultProviderConfiguration().requiredDistanceInterval(), false);
if (!getConfiguration().keepTracking()) {
Copy link
Owner Author

@yayaa yayaa Jan 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing logic was to request as 0 time and distance interval to receive an immediate update, and then remove location request once any location is received and register a new update request with the intervals from configuration.

But since, provider returns a new location for every update request and then wait for the interval, this ended up ignoring the interval completely.

So, the fix is to remove if only keepTracking is false instead of removing by default and registering new requests if true.

@yayaa yayaa merged commit 9293b5d into master Jan 3, 2021
@yayaa yayaa deleted the yb/bug_fix_multiple_location_received branch January 3, 2021 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

location fetching every second
1 participant