fix displaying profile name if Ignore profile switch is checked

This commit is contained in:
Milos Kozak 2018-02-25 21:13:27 +01:00
parent f62cac1b66
commit a1a3b14b18

View file

@ -299,7 +299,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
* 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
* given Plugin Interface.
*
* <p>
* 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 conventions.
@ -743,6 +743,8 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
}
public String getProfileName(long time, boolean customized) {
boolean ignoreProfileSwitchEvents = SP.getBoolean(R.string.key_do_not_track_profile_switch, false);
if (!ignoreProfileSwitchEvents) {
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
if (profileSwitch != null) {
if (profileSwitch.profileJson != null) {
@ -753,6 +755,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr
return profileSwitch.profileName;
}
}
}
// Unable to determine profile, failover to default
String defaultProfile = activeProfile.getProfile().getDefaultProfileName();
if (defaultProfile != null)