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); resumeDelivery(acknowledgementBeeps);
} }
public synchronized void deactivatePod(boolean acknowledgementBeep) { public synchronized void deactivatePod() {
if (podState == null) { if (podState == null) {
throw new IllegalSetupProgressException(SetupProgress.ADDRESS_ASSIGNED, null); throw new IllegalSetupProgressException(SetupProgress.ADDRESS_ASSIGNED, null);
} }
try { 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) { } catch (PodFaultException ex) {
if (isLoggingEnabled()) { if (isLoggingEnabled()) {
LOG.info("Ignoring PodFaultException in deactivatePod", ex); LOG.info("Ignoring PodFaultException in deactivatePod", ex);

View file

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