diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index c47dfb2e08..83212425cf 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -364,18 +364,24 @@ public class OsmandApplication extends Application { } private void startApplicationBackground() { - List warnings = null; + List warnings = new ArrayList(); try { - if (osmandSettings.NATIVE_RENDERING.get()) { + if(osmandSettings.NATIVE_RENDERING_FAILED.get()){ + osmandSettings.NATIVE_RENDERING.set(false); + osmandSettings.NATIVE_RENDERING_FAILED.set(false); + warnings.add(getString(R.string.native_library_not_supported)); + } else if (osmandSettings.NATIVE_RENDERING.get()) { + osmandSettings.NATIVE_RENDERING_FAILED.set(true); startDialog.startTask(getString(R.string.init_native_library), -1); RenderingRulesStorage storage = rendererRegistry.getCurrentSelectedRenderer(); boolean initialized = NativeOsmandLibrary.getLibrary(storage) != null; + osmandSettings.NATIVE_RENDERING_FAILED.set(false); if (!initialized) { LOG.info("Native library could not loaded!"); osmandSettings.NATIVE_RENDERING.set(false); } } - warnings = manager.reloadIndexes(startDialog); + warnings.addAll(manager.reloadIndexes(startDialog)); player = null; SavingTrackHelper helper = new SavingTrackHelper(OsmandApplication.this); if (helper.hasDataToSave()) { diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 5ad47947bf..de9882df38 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1095,7 +1095,9 @@ public class OsmandSettings { public final OsmandPreference TEST_ANIMATE_ROUTING = new BooleanPreference("animate_routing", false, true); // this value string is synchronized with settings_pref.xml preference name - public final OsmandPreference NATIVE_RENDERING = new BooleanPreference("native_rendering", false, true); + public final OsmandPreference NATIVE_RENDERING = new BooleanPreference("native_rendering", true, true); + + public final OsmandPreference NATIVE_RENDERING_FAILED = new BooleanPreference("native_rendering_failed_init", false, true); // this value string is synchronized with settings_pref.xml preference name diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java index a6f4be19f1..7e2a88eed9 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java @@ -203,7 +203,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference registerBooleanPreference(osmandSettings.SHOW_RULER,screen); CheckBoxPreference nativeCheckbox = registerBooleanPreference(osmandSettings.NATIVE_RENDERING,screen); //disable the checkbox if the library cannot be used - if (NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) { + if ((NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) || + osmandSettings.NATIVE_RENDERING_FAILED.get()) { nativeCheckbox.setEnabled(false); }