Add check for already set preference

This commit is contained in:
Vitaliy 2020-07-21 18:15:18 +03:00
parent 8dedb3908a
commit 297edbcf11

View file

@ -328,6 +328,7 @@ public class OsmandSettings {
HashMap<String, Boolean> quickActions = gson.fromJson(quickActionsJson, type);
if (!Algorithms.isEmpty(quickActions)) {
for (ApplicationMode mode : ApplicationMode.allPossibleValues()) {
if (!QUICK_ACTION.isSetForMode(mode)) {
Boolean actionState = quickActions.get(mode.getStringKey());
if (actionState == null) {
actionState = QUICK_ACTION.getDefaultValue();
@ -337,6 +338,7 @@ public class OsmandSettings {
}
}
}
}
public void migrateEnumPreferences() {
for (OsmandPreference pref : registeredPreferences.values()) {