fix issue with back on route prompt

This commit is contained in:
sonora 2016-05-20 12:30:56 +02:00
parent e6a0064586
commit 8460856d98
2 changed files with 10 additions and 9 deletions

View file

@ -82,9 +82,6 @@ public class RoutingHelper {
private RouteCalculationProgressCallback progressRoute;
private boolean announceBackOnRoute = false;
// private ProgressBar progress;
// private Handler progressHandler;
@ -322,7 +319,6 @@ public class RoutingHelper {
if(dist > 350) {
if (isFollowingMode) {
voiceRouter.announceOffRoute(dist);
announceBackOnRoute = true;
}
}
}
@ -373,9 +369,8 @@ public class RoutingHelper {
if(!thread.isParamsChanged()) {
thread.stopCalculation();
}
if (announceBackOnRoute && isFollowingMode){
if (isFollowingMode){
voiceRouter.announceBackOnRoute();
announceBackOnRoute = false;
}
}
}

View file

@ -48,6 +48,7 @@ public class VoiceRouter {
private long waitAnnouncedSpeedLimit = 0;
private long waitAnnouncedOffRoute = 0;
private boolean suppressDest = false;
private boolean announceBackOnRoute = false;
// private long lastTimeRouteRecalcAnnounced = 0;
@ -220,6 +221,7 @@ public class VoiceRouter {
if (p != null) {
notifyOnVoiceMessage();
p.offRoute(dist).play();
announceBackOnRoute = true;
}
if(waitAnnouncedOffRoute == 0) {
waitAnnouncedOffRoute = 60000;
@ -232,10 +234,13 @@ public class VoiceRouter {
public void announceBackOnRoute() {
CommandBuilder p = getNewCommandPlayerToPlay();
if (announceBackOnRoute == true) {
if (p != null) {
notifyOnVoiceMessage();
p.backOnRoute().play();
}
announceBackOnRoute = false;
}
}
public void approachWaypoint(Location location, List<LocationPointWrapper> points){
@ -426,6 +431,7 @@ public class VoiceRouter {
currentStatus = STATUS_UNKNOWN;
suppressDest = false;
playedAndArriveAtTarget = false;
announceBackOnRoute = false;
if (playGoAheadDist != -1) {
playGoAheadDist = 0;
}