diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index d47ecf31ea..f0f6128230 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -59,8 +59,6 @@ public class WaypointHelper { private List> locationPoints = new ArrayList>(); private ConcurrentHashMap locationPointsStates = new ConcurrentHashMap(); - private List alreadyAnnouncedPoints = new ArrayList(); - private List alreadyApproachedPoints = new ArrayList(); private TIntArrayList pointsProgress = new TIntArrayList(); private RouteCalculationResult route; @@ -321,24 +319,15 @@ public class WaypointHelper { if (state != null && state.intValue() == ANNOUNCED_ONCE && getVoiceRouter().isDistanceLess(lastKnownLocation.getSpeed(), d1, SHORT_ANNOUNCE_RADIUS)) { locationPointsStates.put(point, ANNOUNCED_DONE); - if (!alreadyAnnouncedPoints.contains(lwp)){ - announcePoints.add(lwp); - alreadyAnnouncedPoints.add(lwp); - } + announcePoints.add(lwp); } else if (type != ALARMS && (state == null || state == NOT_ANNOUNCED) && getVoiceRouter().isDistanceLess(lastKnownLocation.getSpeed(), d1, LONG_ANNOUNCE_RADIUS)) { locationPointsStates.put(point, ANNOUNCED_ONCE); - if (!alreadyApproachedPoints.contains(lwp)){ - approachPoints.add(lwp); - alreadyApproachedPoints.add(lwp); - } + approachPoints.add(lwp); } else if (type == ALARMS && (state == null || state == NOT_ANNOUNCED) && getVoiceRouter().isDistanceLess(lastKnownLocation.getSpeed(), d1, ALARMS_ANNOUNCE_RADIUS)) { locationPointsStates.put(point, ANNOUNCED_ONCE); - if (!alreadyApproachedPoints.contains(lwp)){ - approachPoints.add(lwp); - alreadyApproachedPoints.add(lwp); - } + approachPoints.add(lwp); } kIterator++; } @@ -417,7 +406,7 @@ public class WaypointHelper { } public void clearAllVisiblePoints() { - this.locationPointsStates.clear(); + //this.locationPointsStates.clear(); this.locationPoints = new ArrayList>(); } @@ -489,7 +478,7 @@ public class WaypointHelper { protected synchronized void setLocationPoints(List> locationPoints, RouteCalculationResult route) { this.locationPoints = locationPoints; - this.locationPointsStates.clear(); + //this.locationPointsStates.clear(); TIntArrayList list = new TIntArrayList(locationPoints.size()); list.fill(0, locationPoints.size(), 0); this.pointsProgress = list;