From 718fb65041bea094c12948946b0b71e837ce454c Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Tue, 23 May 2017 14:53:46 +0300 Subject: [PATCH] Fix #3750 --- .../plus/download/DownloadIndexesThread.java | 6 ++++++ .../src/net/osmand/plus/routing/RoutingHelper.java | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 3dc4b64116..4e2c3013a0 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -437,6 +437,12 @@ public class DownloadIndexesThread { } else { dbHelper.update(entry, DatabaseHelper.DOWNLOAD_ENTRY); } + } else if (o instanceof String) { + String message = (String) o; + // ctx.getString(R.string.shared_string_io_error) +": Interrupted"; + if (!message.toLowerCase().contains("interrupted") && !message.equals(app.getString(R.string.shared_string_download_successful))) { + app.showToastMessage(message); + } } } downloadInProgress(); diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index ce29dc1f93..5b57a3d3ae 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -676,15 +676,13 @@ public class RoutingHelper { l.newRouteIsCalculated(newRoute, showToast); } } - if (showToast.value) { - if (OsmandPlugin.isDevelopment()) { - String msg = app.getString(R.string.new_route_calculated_dist) + ": " - + OsmAndFormatter.getFormattedDistance(res.getWholeDistance(), app); - if (res.getRoutingTime() != 0f) { - msg += " (" + Algorithms.formatDuration((int) res.getRoutingTime(), app.accessibilityEnabled()) + ")"; - } - app.showToastMessage(msg); + if (showToast.value && OsmandPlugin.isDevelopment()) { + String msg = app.getString(R.string.new_route_calculated_dist) + ": " + + OsmAndFormatter.getFormattedDistance(res.getWholeDistance(), app); + if (res.getRoutingTime() != 0f) { + msg += " (" + Algorithms.formatDuration((int) res.getRoutingTime(), app.accessibilityEnabled()) + ")"; } + app.showToastMessage(msg); } } });