Fix silent alert canceling
This commit is contained in:
parent
7724092843
commit
f6d829e575
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue