Changed interval to 0

This commit is contained in:
Victor Shcherb 2015-01-09 00:47:10 +01:00
parent 29032e40e8
commit 2899b6961b

View file

@ -58,7 +58,7 @@ public class RoutingHelper {
private Thread currentRunningJob;
private long lastTimeEvaluatedRoute = 0;
private int evalWaitInterval = 3000;
private int evalWaitInterval = 0;
private ApplicationMode mode;
private OsmandSettings settings;
@ -144,7 +144,7 @@ public class RoutingHelper {
public synchronized void clearCurrentRoute(LatLon newFinalLocation, List<LatLon> newIntermediatePoints) {
route = new RouteCalculationResult("");
isDeviatedFromRoute = false;
evalWaitInterval = 3000;
evalWaitInterval = 0;
app.getWaypointHelper().setNewRoute(route);
app.runInUIThread(new Runnable() {
@Override
@ -561,9 +561,13 @@ public class RoutingHelper {
// This check is valid for Online/GPX services (offline routing is aware of route direction)
wrongMovementDirection = checkWrongMovementDirection(start, routeNodes.get(newCurrentRoute + 1));
// set/reset evalWaitInterval only if new route is in forward direction
if (!wrongMovementDirection) {
evalWaitInterval = 3000;
} else {
if(evalWaitInterval == 0){
evalWaitInterval = 3000;
}
evalWaitInterval = evalWaitInterval * 3 / 2;
evalWaitInterval = Math.min(evalWaitInterval, 120000);
}