Skip to content

Commit

Permalink
Remove last location check from location validation
Browse files Browse the repository at this point in the history
  • Loading branch information
danesfeder committed Mar 20, 2018
1 parent ee49c09 commit 76b9dfb
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,7 @@ private void startForegroundNotification(Notification notification, int notifica
*/
@SuppressWarnings("MissingPermission")
private boolean isValidLocationUpdate(Location location) {
if (location == null) {
return false;
}
// If the locations the same as previous, no need to recalculate things
return !(location.equals(locationEngine.getLastLocation())
|| (location.getSpeed() <= 0 && location.hasSpeed())
|| location.getAccuracy() >= 100);
return location != null && location.hasSpeed() && location.getAccuracy() <= 100;
}

/**
Expand Down

0 comments on commit 76b9dfb

Please sign in to comment.