Fix NoClassDefFoundError for old android version

This commit is contained in:
Vitaliy 2021-03-25 22:49:31 +02:00
parent a0be550d04
commit 27cf399bd9
2 changed files with 4 additions and 5 deletions

View file

@ -6,7 +6,6 @@ import net.osmand.NativeLibrary;
import net.osmand.PlatformUtil;
import net.osmand.ResultMatcher;
import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.binary.BinaryMapRouteReaderAdapter;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion;
import net.osmand.binary.RouteDataObject;
import net.osmand.data.LatLon;
@ -689,15 +688,15 @@ public class RoutePlannerFrontEnd {
}
}
if (ctx.calculationMode == RouteCalculationMode.COMPLEX && routeDirection == null
&& maxDistance > ctx.config.DEVIATION_RADIUS * 6) {
&& maxDistance > RoutingConfiguration.DEVIATION_RADIUS * 6) {
ctx.calculationProgress.totalIterations++;
RoutingContext nctx = buildRoutingContext(ctx.config, ctx.nativeLib, ctx.getMaps(), RouteCalculationMode.BASE);
nctx.calculationProgress = ctx.calculationProgress;
List<RouteSegmentResult> ls = searchRoute(nctx, start, end, intermediates);
if(ls == null) {
if (ls == null) {
return null;
}
routeDirection = PrecalculatedRouteDirection.build(ls, ctx.config.DEVIATION_RADIUS, ctx.getRouter().getMaxSpeed());
routeDirection = PrecalculatedRouteDirection.build(ls, RoutingConfiguration.DEVIATION_RADIUS, ctx.getRouter().getMaxSpeed());
}
List<RouteSegmentResult> res ;
if (intermediatesEmpty && ctx.nativeLib != null) {

View file

@ -20,7 +20,7 @@ import java.util.Stack;
public class RoutingConfiguration {
public static final int DEFAULT_MEMORY_LIMIT = 30;
public final float DEVIATION_RADIUS = 3000;
public static final float DEVIATION_RADIUS = 3000;
public Map<String, String> attributes = new LinkedHashMap<String, String>();
// 1. parameters of routing and different tweaks