diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java index 47ab04446b..efc0376ffa 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java @@ -246,8 +246,8 @@ public class TrackBitmapDrawer { } } paint.setColor(color == 0 ? trackColor : color); - if(ts.renderer instanceof Renderable.RenderableSegment) { - ((Renderable.RenderableSegment)ts.renderer).drawSegment(tileBox.getZoom(), paint, canvas, tileBox); + if (ts.renderer instanceof Renderable.RenderableSegment) { + ((Renderable.RenderableSegment) ts.renderer).drawSegment(tileBox.getZoom(), paint, canvas, tileBox); } } } diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index 2b4808929a..43aaff0668 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -901,7 +901,7 @@ public class VoiceRouter { } else if (type == ROUTE_RECALCULATED) { newCommand.routeRecalculated(left, time); } - play(newCommand); + VoiceRouter.play(newCommand); } } } diff --git a/OsmAnd/src/net/osmand/plus/views/Renderable.java b/OsmAnd/src/net/osmand/plus/views/Renderable.java index 162320f26d..c4581c329e 100644 --- a/OsmAnd/src/net/osmand/plus/views/Renderable.java +++ b/OsmAnd/src/net/osmand/plus/views/Renderable.java @@ -2,18 +2,21 @@ package net.osmand.plus.views; import android.graphics.Canvas; import android.graphics.Paint; -import android.os.AsyncTask; +import net.osmand.GPXUtilities.WptPt; import net.osmand.data.QuadRect; import net.osmand.data.RotatedTileBox; -import net.osmand.GPXUtilities.WptPt; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; public class Renderable { + private static final Executor THREAD_POOL_EXECUTOR = Executors.newFixedThreadPool(5); + public static abstract class RenderableSegment { public List points = null; // Original list of points @@ -139,7 +142,7 @@ public class Renderable { double cullDistance = Math.pow(2.0, segmentSize - zoom); // segmentSize == epsilon culler = new AsynchronousResampler.RamerDouglasPeucer(this, cullDistance); - culler.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, ""); + culler.executeOnExecutor(THREAD_POOL_EXECUTOR, ""); } }