diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/InsightAlertService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/InsightAlertService.java index 0873bc958d..9122132de8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/InsightAlertService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/InsightAlertService.java @@ -80,8 +80,13 @@ public class InsightAlertService extends Service implements InsightConnectionSer public void ignore(AlertType alertType) { synchronized ($alertLock) { - ignoreTimestamp = System.currentTimeMillis(); - ignoreType = alertType; + if (alertType == null) { + ignoreTimestamp = 0; + ignoreType = null; + } else { + ignoreTimestamp = System.currentTimeMillis(); + ignoreType = alertType; + } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java index 47da3f7c3e..654be9d08d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java @@ -735,11 +735,13 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con private PumpEnactResult cancelTempBasalOnly() { PumpEnactResult result = new PumpEnactResult(); try { + alertService.ignore(AlertType.WARNING_36); connectionService.requestMessage(new CancelTBRMessage()).await(); result.success = true; result.enacted = true; result.isTempCancel = true; confirmAlert(AlertType.WARNING_36); + alertService.ignore(null); result.comment = MainApp.gs(R.string.virtualpump_resultok); } catch (NoActiveTBRToCanceLException e) { result.success = true; @@ -773,6 +775,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con cancelBolusMessage.setBolusID(activeBolus.getBolusID()); connectionService.requestMessage(cancelBolusMessage).await(); confirmAlert(AlertType.WARNING_38); + alertService.ignore(null); InsightBolusID insightBolusID = MainApp.getDbHelper().getInsightBolusID(connectionService.getPumpSystemIdentification().getSerialNumber(), activeBolus.getBolusID(), System.currentTimeMillis()); if (insightBolusID != null) {