Commit 635a32ab authored by Chris Scott's avatar Chris Scott

Bug in comparing Integer when calculating distanceFilter changes. always...

Bug in comparing Integer when calculating distanceFilter changes.  always evaluated to a change in distanceFilter on each location change
parent 34a0297a
...@@ -322,7 +322,7 @@ public class LocationUpdateService extends Service implements LocationListener { ...@@ -322,7 +322,7 @@ public class LocationUpdateService extends Service implements LocationListener {
} }
// Calculate latest distanceFilter, if it changed by 5 m/s, we'll reconfigure our pace. // Calculate latest distanceFilter, if it changed by 5 m/s, we'll reconfigure our pace.
Integer newDistanceFilter = calculateDistanceFilter(location.getSpeed()); Integer newDistanceFilter = calculateDistanceFilter(location.getSpeed());
if (newDistanceFilter != scaledDistanceFilter) { if (newDistanceFilter != scaledDistanceFilter.intValue()) {
Log.i(TAG, "- updated distanceFilter, new: " + newDistanceFilter + ", old: " + scaledDistanceFilter); Log.i(TAG, "- updated distanceFilter, new: " + newDistanceFilter + ", old: " + scaledDistanceFilter);
scaledDistanceFilter = newDistanceFilter; scaledDistanceFilter = newDistanceFilter;
setPace(true); setPace(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment