simplify code

This commit is contained in:
sonora 2012-02-02 01:31:48 +01:00
parent 64b4ce6973
commit 82cd5092a6

View file

@ -1,9 +1,9 @@
package net.osmand.plus.routing; package net.osmand.plus.routing;
import net.osmand.plus.activities.ApplicationMode; import net.osmand.plus.activities.ApplicationMode;
//import net.osmand.plus.OsmandSettings;
import net.osmand.plus.routing.RoutingHelper.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper.TurnType; import net.osmand.plus.routing.RoutingHelper.TurnType;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.voice.AbstractPrologCommandPlayer; import net.osmand.plus.voice.AbstractPrologCommandPlayer;
import net.osmand.plus.voice.CommandBuilder; import net.osmand.plus.voice.CommandBuilder;
import net.osmand.plus.voice.CommandPlayer; import net.osmand.plus.voice.CommandPlayer;
@ -348,10 +348,10 @@ public class VoiceRouter {
if (updateRoute) { if (updateRoute) {
//suppress "route recaluated" message for 60sec //suppress "route recaluated" message for 60sec
if (System.currentTimeMillis() - lastTimeRouteRecalcAnnounced > 60000) { if (System.currentTimeMillis() - lastTimeRouteRecalcAnnounced > 60000) {
//if (OsmandSettings.getOsmandSettings(this).FOLLOW_THE_GPX_ROUTE.get() == null) { if (router.getCurrentGPXRoute() == null) {
play.routeRecalculated(router.getLeftDistance()).play(); play.routeRecalculated(router.getLeftDistance()).play();
lastTimeRouteRecalcAnnounced = System.currentTimeMillis(); lastTimeRouteRecalcAnnounced = System.currentTimeMillis();
//} }
} }
} else { } else {
play.newRouteCalculated(router.getLeftDistance()).play(); play.newRouteCalculated(router.getLeftDistance()).play();
@ -401,10 +401,10 @@ public class VoiceRouter {
} else if (type == ROUTE_RECALCULATED) { } else if (type == ROUTE_RECALCULATED) {
//suppress "route recaluated" message for 60sec //suppress "route recaluated" message for 60sec
if (System.currentTimeMillis() - lastTimeRouteRecalcAnnounced > 60000) { if (System.currentTimeMillis() - lastTimeRouteRecalcAnnounced > 60000) {
//if (OsmandSettings.getOsmandSettings(this).FOLLOW_THE_GPX_ROUTE.get() == null) { if (router.getCurrentGPXRoute() == null) {
newCommand.routeRecalculated(left).play(); newCommand.routeRecalculated(left).play();
lastTimeRouteRecalcAnnounced = System.currentTimeMillis(); lastTimeRouteRecalcAnnounced = System.currentTimeMillis();
//} }
} }
} }
} }