From 9b1d9e23a5b3eca060b652aeb133316b9214bfb8 Mon Sep 17 00:00:00 2001 From: Chumva Date: Wed, 16 Oct 2019 16:08:38 +0300 Subject: [PATCH] Add safe mode pref to development plugin settings --- .../plus/development/SettingsDevelopmentActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index 432fb53164..996a1be09b 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -17,6 +17,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.SettingsBaseActivity; +import net.osmand.plus.render.NativeOsmandLibrary; import net.osmand.util.SunriseSunset; import java.text.SimpleDateFormat; @@ -37,6 +38,15 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { cat.addPreference(createCheckBoxPreference(settings.USE_OPENGL_RENDER, R.string.use_opengl_render,R.string.use_opengl_render_descr)); + CheckBoxPreference nativeCheckbox = createCheckBoxPreference(settings.SAFE_MODE, R.string.safe_mode, + R.string.safe_mode_description); + // disable the checkbox if the library cannot be used + if ((NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) || settings.NATIVE_RENDERING_FAILED.get()) { + nativeCheckbox.setEnabled(false); + nativeCheckbox.setChecked(true); + } + cat.addPreference(nativeCheckbox); + PreferenceCategory navigation = new PreferenceCategory(this); navigation.setTitle(R.string.routing_settings); cat.addPreference(navigation);