Make custom profiles inherit enabled plugins

This commit is contained in:
Chumva 2019-11-11 18:59:46 +02:00
parent 6e801c232e
commit 31df0492eb
2 changed files with 12 additions and 1 deletions

View file

@ -1267,6 +1267,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
if (api != null && params != null) {
String colorName = api.getGpxColor(params.getFileName());
params.setGpxColor(colorName);
return true;
}
return false;
} catch (Exception e) {

View file

@ -996,7 +996,17 @@ public class OsmandSettings {
public static final String NUMBER_OF_FREE_DOWNLOADS_ID = "free_downloads_v3";
// this value string is synchronized with settings_pref.xml preference name
private final OsmandPreference<String> PLUGINS = new StringPreference("enabled_plugins", MapillaryPlugin.ID).makeProfile();
private final OsmandPreference<String> PLUGINS = new StringPreference("enabled_plugins", MapillaryPlugin.ID) {
@Override
public String getProfileDefaultValue(ApplicationMode mode) {
ApplicationMode parent = mode.getParent();
if (parent != null && isSetForMode(parent)) {
return getModeValue(parent);
} else {
return super.getProfileDefaultValue(mode);
}
}
}.makeProfile();
public Set<String> getEnabledPlugins() {
String plugs = PLUGINS.get();