diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java index 8ef6ec2fc6..9974471528 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java @@ -112,7 +112,7 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL stopPressed = true; stopPressedView.setVisibility(View.VISIBLE); stopButton.setVisibility(View.INVISIBLE); - ConfigBuilderPlugin.getActivePump().stopBolusDelivering(); + ConfigBuilderPlugin.getCommandQueue().cancelAllBoluses(); break; } } diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java index d2fd2a5e24..cc28eb28a0 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java @@ -213,6 +213,12 @@ public class CommandQueue { return true; } + public synchronized void cancelAllBoluses() { + removeAll(Command.CommandType.BOLUS); + removeAll(Command.CommandType.SMB_BOLUS); + ConfigBuilderPlugin.getActivePump().stopBolusDelivering(); + } + // returns true if command is queued public boolean tempBasalAbsolute(double absoluteRate, int durationInMinutes, boolean enforceNew, Profile profile, Callback callback) { if (!enforceNew && isRunning(Command.CommandType.TEMPBASAL)) {