From 5f859054c6eb8cf4f73292afb5256ec88623eecc Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 16 Mar 2012 12:25:17 +0100 Subject: [PATCH] introduce better reset for when route should be recalculated to save some internet traffic --- OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 69ed5c9714..70fa49d498 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -418,6 +418,10 @@ public class RoutingHelper { if(isFollowingMode){ tryMarkPassedRoute(start); directionDetection(start); + // reset evalWaitInterval only if new route is in forward direction + if(!suppressTurnPrompt){ + evalWaitInterval = 3001; + } voiceRouter.newRouteIsCalculated(updateRoute, suppressTurnPrompt); } currentRoute = 0; @@ -569,7 +573,8 @@ public class RoutingHelper { if (res.isCalculated()) { setNewRoute(res, start); // reset error wait interval - evalWaitInterval = 3001; + // reset evalWaitInterval in setNewRoute and only if new route is in forward direction + // evalWaitInterval = 3001; } else { evalWaitInterval = evalWaitInterval * 4 / 3; if (evalWaitInterval > 120000) {