Disable osmc routing

This commit is contained in:
Victor Shcherb 2016-03-15 08:38:21 -04:00
parent 38dcc92f2b
commit 16ebf1f748
2 changed files with 5 additions and 1 deletions

View file

@ -2401,6 +2401,8 @@ public class OsmandSettings {
return customBooleanRoutingProps.get(attrName); return customBooleanRoutingProps.get(attrName);
} }
public final OsmandPreference<Boolean> USE_OSM_LIVE_FOR_ROUTING = new BooleanPreference("enable_osmc_routing", false).makeGlobal();
public final OsmandPreference<Boolean> VOICE_MUTE = new BooleanPreference("voice_mute", false).makeGlobal(); public final OsmandPreference<Boolean> VOICE_MUTE = new BooleanPreference("voice_mute", false).makeGlobal();
// for background service // for background service

View file

@ -697,7 +697,9 @@ public class ResourceManager {
warnings.add(MessageFormat.format(context.getString(R.string.version_index_is_not_supported), f.getName())); //$NON-NLS-1$ warnings.add(MessageFormat.format(context.getString(R.string.version_index_is_not_supported), f.getName())); //$NON-NLS-1$
} }
} }
if (mapReader.containsRouteData()) { // disable osmc for routing temporarily due to some bugs
if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) ||
context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) {
try { try {
RandomAccessFile raf = new RandomAccessFile(f, "r"); //$NON-NLS-1$ RandomAccessFile raf = new RandomAccessFile(f, "r"); //$NON-NLS-1$
routingMapFiles.put(f.getName(), new BinaryMapIndexReader(raf, mapReader)); routingMapFiles.put(f.getName(), new BinaryMapIndexReader(raf, mapReader));