Remove last location check from location validation#788
Merged
Conversation
665558d to
76b9dfb
Compare
Contributor
Guardiola31337
left a comment
There was a problem hiding this comment.
would never be considered valid
Why? Could you clarify?
I'm not even sure if the location apis would ever fire with the getLastLocation twice in a row
Not following here. What do you mean?
| return !(location.equals(locationEngine.getLastLocation()) | ||
| || (location.getSpeed() <= 0 && location.hasSpeed()) | ||
| || location.getAccuracy() >= 100); | ||
| return location != null && location.hasSpeed() && location.getAccuracy() <= 100; |
Contributor
There was a problem hiding this comment.
Magic number 100. Location#getAccuracy returns the estimated horizontal accuracy of this location, radial, in meters what about extracting a constant and give it a name based on what getAccuracy Javadoc states?
3fa053f to
fe59295
Compare
Guardiola31337
approved these changes
Mar 22, 2018
Contributor
Guardiola31337
left a comment
There was a problem hiding this comment.
After CI finishes 🚀
fe59295 to
ff22ba4
Compare
ff22ba4 to
45dad60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found that when starting navigation, the forced location update from
LocationEngine#getLastLocationwould never be considered valid and we would subsequently fall back to to creating the location update from the first point on the route:master:I removed the check, as this should be an edge case (I'm not even sure if the location apis would ever fire with the
getLastLocationtwice in a row) 🤔