diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 40f2518ce7..75f1de630d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -651,9 +651,6 @@ public class ConfigBuilderPlugin implements PluginBase, TreatmentsInterface { @Subscribe public void onProfileSwitch(EventProfileSwitchChange ignored) { - if (getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) - return; - getCommandQueue().setProfile(getProfile(), new Callback() { @Override public void run() { diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveReceiver.java b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveReceiver.java index 87f1f5a7b0..af46321901 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveReceiver.java +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveReceiver.java @@ -22,8 +22,8 @@ import info.nightscout.androidaps.events.EventProfileSwitchChange; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; +import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.utils.LocalAlertUtils; -import info.nightscout.utils.SP; public class KeepAliveReceiver extends BroadcastReceiver { private static Logger log = LoggerFactory.getLogger(KeepAliveReceiver.class); @@ -60,7 +60,7 @@ public class KeepAliveReceiver extends BroadcastReceiver { LocalAlertUtils.checkPumpUnreachableAlarm(lastConnection, isStatusOutdated); - if (!pump.isThisProfileSet(profile)) { + if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) { MainApp.bus().post(new EventProfileSwitchChange()); } else if (isStatusOutdated && !pump.isBusy()) { ConfigBuilderPlugin.getCommandQueue().readStatus("KeepAlive. Status outdated.", null);