fix displaying profile name if Ignore profile switch is checked
This commit is contained in:
parent
f62cac1b66
commit
a1a3b14b18
1 changed files with 14 additions and 11 deletions
|
@ -263,7 +263,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
|
||||||
activePump = (PumpInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.PUMP);
|
activePump = (PumpInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.PUMP);
|
||||||
if (activePump == null)
|
if (activePump == null)
|
||||||
activePump = VirtualPumpPlugin.getPlugin(); // for NSClient build
|
activePump = VirtualPumpPlugin.getPlugin(); // for NSClient build
|
||||||
this.setFragmentVisiblities(((PluginBase)activePump).getName(), pluginsInCategory, PluginBase.PUMP);
|
this.setFragmentVisiblities(((PluginBase) activePump).getName(), pluginsInCategory, PluginBase.PUMP);
|
||||||
|
|
||||||
// PluginBase.LOOP
|
// PluginBase.LOOP
|
||||||
activeLoop = this.determineActivePlugin(PluginBase.LOOP);
|
activeLoop = this.determineActivePlugin(PluginBase.LOOP);
|
||||||
|
@ -299,7 +299,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
|
||||||
* disables the visibility for all fragments of Plugins in the given pluginsInCategory
|
* disables the visibility for all fragments of Plugins in the given pluginsInCategory
|
||||||
* with the given PluginType which are not equally named to the Plugin implementing the
|
* with the given PluginType which are not equally named to the Plugin implementing the
|
||||||
* given Plugin Interface.
|
* given Plugin Interface.
|
||||||
*
|
* <p>
|
||||||
* TODO we are casting an interface to PluginBase, which seems to be rather odd, since
|
* TODO we are casting an interface to PluginBase, which seems to be rather odd, since
|
||||||
* TODO the interface is not implementing PluginBase (this is just avoiding errors through
|
* TODO the interface is not implementing PluginBase (this is just avoiding errors through
|
||||||
* TODO conventions.
|
* TODO conventions.
|
||||||
|
@ -314,7 +314,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
|
||||||
T activePlugin = (T) getTheOneEnabledInArray(pluginsInCategory, pluginType);
|
T activePlugin = (T) getTheOneEnabledInArray(pluginsInCategory, pluginType);
|
||||||
|
|
||||||
if (activePlugin != null) {
|
if (activePlugin != null) {
|
||||||
this.setFragmentVisiblities(((PluginBase)activePlugin).getName(),
|
this.setFragmentVisiblities(((PluginBase) activePlugin).getName(),
|
||||||
pluginsInCategory, pluginType);
|
pluginsInCategory, pluginType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,14 +743,17 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProfileName(long time, boolean customized) {
|
public String getProfileName(long time, boolean customized) {
|
||||||
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
|
boolean ignoreProfileSwitchEvents = SP.getBoolean(R.string.key_do_not_track_profile_switch, false);
|
||||||
if (profileSwitch != null) {
|
if (!ignoreProfileSwitchEvents) {
|
||||||
if (profileSwitch.profileJson != null) {
|
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
|
||||||
return customized ? profileSwitch.getCustomizedName() : profileSwitch.profileName;
|
if (profileSwitch != null) {
|
||||||
} else {
|
if (profileSwitch.profileJson != null) {
|
||||||
Profile profile = activeProfile.getProfile().getSpecificProfile(profileSwitch.profileName);
|
return customized ? profileSwitch.getCustomizedName() : profileSwitch.profileName;
|
||||||
if (profile != null)
|
} else {
|
||||||
return profileSwitch.profileName;
|
Profile profile = activeProfile.getProfile().getSpecificProfile(profileSwitch.profileName);
|
||||||
|
if (profile != null)
|
||||||
|
return profileSwitch.profileName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Unable to determine profile, failover to default
|
// Unable to determine profile, failover to default
|
||||||
|
|
Loading…
Reference in a new issue