Fix backup agent crash

This commit is contained in:
vshcherb 2014-03-31 00:12:37 +02:00
parent 4ba932bb6e
commit 86ed84b531
4 changed files with 5 additions and 5 deletions

View file

@ -176,7 +176,7 @@ public class ApplicationMode {
return cachedFilteredValues;
}
public static List<ApplicationMode> allPossibleValues(OsmandSettings settings) {
public static List<ApplicationMode> allPossibleValues() {
return new ArrayList<ApplicationMode>(values);
}

View file

@ -13,8 +13,8 @@ public class OsmandBackupAgent extends BackupAgentHelper {
@Override
public void onCreate() {
OsmandApplication app = (OsmandApplication) getApplicationContext();
List<ApplicationMode> all = ApplicationMode.allPossibleValues(app.getSettings());
// can't cast to OsmAnd Application
List<ApplicationMode> all = ApplicationMode.allPossibleValues();
String[] prefs = new String[all.size() + 1];
prefs[0] = OsmandSettings.getSharedPreferencesName(null);
int i = 1;

View file

@ -106,7 +106,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
protected void availableProfileDialog() {
Builder b = new AlertDialog.Builder(this);
final List<ApplicationMode> modes = ApplicationMode.allPossibleValues(settings);
final List<ApplicationMode> modes = ApplicationMode.allPossibleValues();
modes.remove(ApplicationMode.DEFAULT);
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>(ApplicationMode.values(settings));
selected.remove(ApplicationMode.DEFAULT);

View file

@ -32,7 +32,7 @@ public class SRTMPlugin extends OsmandPlugin {
OsmandSettings settings = app.getSettings();
CommonPreference<String> 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");
}