Skip to content

Commit

Permalink
Allow passive locations, but check that its time is greater than any …
Browse files Browse the repository at this point in the history
…previous time

Issue #1059
  • Loading branch information
mendhak committed Jul 7, 2023
1 parent 03113c7 commit baf7a99
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,14 @@ void onLocationChanged(Location loc) {
return;
}

// Even if it's a passive location, the time should be greater than the previous location's time.
if(isPassiveLocation && session.getPreviousLocationInfo() != null && loc.getTime() <= session.getPreviousLocationInfo().getTime()){
LOG.debug("Passive location time: " + loc.getTime() + ", previous location's time: " + session.getPreviousLocationInfo().getTime());
LOG.debug("Passive location received, but its time was less than the previous point's time.");
return;
}


//Don't log a point if user has been still
// However, if user has set an annotation, just log the point, disregard time and distance filters
if(userHasBeenStillForTooLong()) {
Expand Down

0 comments on commit baf7a99

Please sign in to comment.