Make custom profiles inherit enabled plugins
This commit is contained in:
parent
6e801c232e
commit
31df0492eb
2 changed files with 12 additions and 1 deletions
|
@ -1267,6 +1267,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
||||||
if (api != null && params != null) {
|
if (api != null && params != null) {
|
||||||
String colorName = api.getGpxColor(params.getFileName());
|
String colorName = api.getGpxColor(params.getFileName());
|
||||||
params.setGpxColor(colorName);
|
params.setGpxColor(colorName);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -996,7 +996,17 @@ public class OsmandSettings {
|
||||||
public static final String NUMBER_OF_FREE_DOWNLOADS_ID = "free_downloads_v3";
|
public static final String NUMBER_OF_FREE_DOWNLOADS_ID = "free_downloads_v3";
|
||||||
|
|
||||||
// this value string is synchronized with settings_pref.xml preference name
|
// 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() {
|
public Set<String> getEnabledPlugins() {
|
||||||
String plugs = PLUGINS.get();
|
String plugs = PLUGINS.get();
|
||||||
|
|
Loading…
Reference in a new issue