From 86ed84b531d69b2f5924a8666f05ad4f293de1d7 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Mon, 31 Mar 2014 00:12:37 +0200 Subject: [PATCH] Fix backup agent crash --- OsmAnd/src/net/osmand/plus/ApplicationMode.java | 2 +- OsmAnd/src/net/osmand/plus/OsmandBackupAgent.java | 4 ++-- .../osmand/plus/development/SettingsDevelopmentActivity.java | 2 +- OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java index aa2debd003..88cdc51e60 100644 --- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java @@ -176,7 +176,7 @@ public class ApplicationMode { return cachedFilteredValues; } - public static List allPossibleValues(OsmandSettings settings) { + public static List allPossibleValues() { return new ArrayList(values); } diff --git a/OsmAnd/src/net/osmand/plus/OsmandBackupAgent.java b/OsmAnd/src/net/osmand/plus/OsmandBackupAgent.java index e181892db8..1b6cee8980 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandBackupAgent.java +++ b/OsmAnd/src/net/osmand/plus/OsmandBackupAgent.java @@ -13,8 +13,8 @@ public class OsmandBackupAgent extends BackupAgentHelper { @Override public void onCreate() { - OsmandApplication app = (OsmandApplication) getApplicationContext(); - List all = ApplicationMode.allPossibleValues(app.getSettings()); + // can't cast to OsmAnd Application + List all = ApplicationMode.allPossibleValues(); String[] prefs = new String[all.size() + 1]; prefs[0] = OsmandSettings.getSharedPreferencesName(null); int i = 1; diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index 79fad45d10..8ef346ccc3 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -106,7 +106,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { protected void availableProfileDialog() { Builder b = new AlertDialog.Builder(this); - final List modes = ApplicationMode.allPossibleValues(settings); + final List modes = ApplicationMode.allPossibleValues(); modes.remove(ApplicationMode.DEFAULT); final Set selected = new LinkedHashSet(ApplicationMode.values(settings)); selected.remove(ApplicationMode.DEFAULT); diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java index c74a7c1035..db28d9df22 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java @@ -32,7 +32,7 @@ public class SRTMPlugin extends OsmandPlugin { OsmandSettings settings = app.getSettings(); CommonPreference pref = settings.getCustomRenderProperty("contourLines"); if(pref.get().equals("")) { - for(ApplicationMode m : ApplicationMode.allPossibleValues(settings)) { + for(ApplicationMode m : ApplicationMode.allPossibleValues()) { if(pref.getModeValue(m).equals("")) { pref.setModeValue(m, "13"); }