Fix NavigationNotification and NavResumePauseAction "continue" button problem in the end of navigation.

This commit is contained in:
Nazar 2019-08-28 15:29:14 +03:00
parent c2e85bbded
commit dba435a7d9
2 changed files with 4 additions and 3 deletions

View file

@ -76,6 +76,7 @@ public class NavigationNotification extends OsmandNotification {
RoutingHelper routingHelper = app.getRoutingHelper(); RoutingHelper routingHelper = app.getRoutingHelper();
routingHelper.setRoutePlanningMode(false); routingHelper.setRoutePlanningMode(false);
routingHelper.setFollowingMode(true); routingHelper.setFollowingMode(true);
routingHelper.setCurrentLocation(app.getLocationProvider().getLastKnownLocation(), false);
} }
}, new IntentFilter(OSMAND_RESUME_NAVIGATION_SERVICE_ACTION)); }, new IntentFilter(OSMAND_RESUME_NAVIGATION_SERVICE_ACTION));
@ -131,7 +132,6 @@ public class NavigationNotification extends OsmandNotification {
turnBitmap = null; turnBitmap = null;
ongoing = true; ongoing = true;
RoutingHelper routingHelper = app.getRoutingHelper(); RoutingHelper routingHelper = app.getRoutingHelper();
boolean followingMode = routingHelper.isFollowingMode() || app.getLocationProvider().getLocationSimulation().isRouteAnimating();
if (service != null && (service.getUsedBy() & USED_BY_NAVIGATION) != 0) { if (service != null && (service.getUsedBy() & USED_BY_NAVIGATION) != 0) {
color = app.getResources().getColor(R.color.osmand_orange); color = app.getResources().getColor(R.color.osmand_orange);
@ -146,7 +146,7 @@ public class NavigationNotification extends OsmandNotification {
int nextTurnDistance = 0; int nextTurnDistance = 0;
int nextNextTurnDistance = 0; int nextNextTurnDistance = 0;
RouteDirectionInfo ri = null; RouteDirectionInfo ri = null;
if (routingHelper.isRouteCalculated() && followingMode) { if (routingHelper.isRouteCalculated() && routingHelper.isFollowingMode()) {
deviatedFromRoute = routingHelper.isDeviatedFromRoute(); deviatedFromRoute = routingHelper.isDeviatedFromRoute();
if (deviatedFromRoute) { if (deviatedFromRoute) {
@ -230,7 +230,7 @@ public class NavigationNotification extends OsmandNotification {
notificationBuilder.addAction(R.drawable.ic_action_remove_dark, notificationBuilder.addAction(R.drawable.ic_action_remove_dark,
app.getString(R.string.shared_string_control_stop), stopPendingIntent); app.getString(R.string.shared_string_control_stop), stopPendingIntent);
if (routingHelper.isRouteCalculated() && followingMode) { if (routingHelper.isRouteCalculated() && routingHelper.isFollowingMode()) {
Intent pauseIntent = new Intent(OSMAND_PAUSE_NAVIGATION_SERVICE_ACTION); Intent pauseIntent = new Intent(OSMAND_PAUSE_NAVIGATION_SERVICE_ACTION);
PendingIntent pausePendingIntent = PendingIntent.getBroadcast(app, 0, pauseIntent, PendingIntent pausePendingIntent = PendingIntent.getBroadcast(app, 0, pauseIntent,
PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT);

View file

@ -30,6 +30,7 @@ public class NavResumePauseAction extends QuickAction {
if (routingHelper.isRoutePlanningMode()) { if (routingHelper.isRoutePlanningMode()) {
routingHelper.setRoutePlanningMode(false); routingHelper.setRoutePlanningMode(false);
routingHelper.setFollowingMode(true); routingHelper.setFollowingMode(true);
routingHelper.setCurrentLocation(activity.getMyApplication().getLocationProvider().getLastKnownLocation(), false);
} else { } else {
routingHelper.setRoutePlanningMode(true); routingHelper.setRoutePlanningMode(true);
routingHelper.setFollowingMode(false); routingHelper.setFollowingMode(false);