From 1f9cd1f907e79906af5df6f06f3825020c5d61d8 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Wed, 24 Dec 2014 17:38:13 +0200 Subject: [PATCH] make voice router SHUT THE FUCK OUT after cancelling navigation --- OsmAnd/src/net/osmand/plus/OsmandApplication.java | 2 +- OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java | 1 + OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 3968ca0eca..dd3977a80b 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -211,7 +211,7 @@ public class OsmandApplication extends Application { public void onTerminate() { super.onTerminate(); if (routingHelper != null) { - routingHelper.getVoiceRouter().onApplicationTerminate(this); + routingHelper.getVoiceRouter().onApplicationTerminate(); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 37cd8de3a9..c888428038 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -951,6 +951,7 @@ public class MapActivityActions implements DialogProvider { if(getMyApplication().getLocationProvider().getLocationSimulation().isRouteAnimating()) { getMyApplication().getLocationProvider().getLocationSimulation().startStopRouteAnimation(mapActivity); } + routingHelper.getVoiceRouter().interruptRouteCommands(); routingHelper.clearCurrentRoute(null, new ArrayList()); routingHelper.setRoutePlanningMode(false); settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get()); diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index 5f71dc142b..31daa2b40f 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -793,7 +793,7 @@ public class VoiceRouter { // } //} - public void onApplicationTerminate(Context ctx) { + public void onApplicationTerminate() { if (player != null) { player.clear(); }