Don't emit acknowledgement beeps when cancelling delivery before deactivating pod

This commit is contained in:
Bart Sopers 2019-12-08 18:53:45 +01:00
parent 057927d24e
commit e350856161
2 changed files with 4 additions and 3 deletions

View file

@ -282,13 +282,14 @@ public class OmnipodManager {
resumeDelivery(acknowledgementBeeps);
}
public synchronized void deactivatePod(boolean acknowledgementBeep) {
public synchronized void deactivatePod() {
if (podState == null) {
throw new IllegalSetupProgressException(SetupProgress.ADDRESS_ASSIGNED, null);
}
try {
executeAndVerify(() -> communicationService.executeAction(new DeactivatePodAction(podState, acknowledgementBeep)));
// Never send acknowledgement beeps here. Matches the PDM's behavior
executeAndVerify(() -> communicationService.executeAction(new DeactivatePodAction(podState, false)));
} catch (PodFaultException ex) {
if (isLoggingEnabled()) {
LOG.info("Ignoring PodFaultException in deactivatePod", ex);

View file

@ -182,7 +182,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
@Override
public PumpEnactResult deactivatePod(PodInitReceiver podInitReceiver) {
try {
delegate.deactivatePod(true);
delegate.deactivatePod();
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
podInitReceiver.returnInitTaskStatus(PodInitActionType.DeactivatePodWizardStep, false, comment);