Properly dismiss Pod suspended notification

This commit is contained in:
Bart Sopers 2020-12-15 00:41:42 +01:00
parent 78616b1041
commit 06ff69d003

View file

@ -336,11 +336,9 @@ public class AapsOmnipodManager {
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
sendEvent(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
if (historyEntryType == PodHistoryEntryType.RESUME_DELIVERY) {
cancelSuspendedFakeTbrIfExists();
sendEvent(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
}
addSuccessToHistory(historyEntryType, profile.getBasalValues());
@ -349,6 +347,9 @@ public class AapsOmnipodManager {
showNotification(Notification.PROFILE_SET_OK, resourceHelper.gs(R.string.profile_set_ok), Notification.INFO, null);
}
sendEvent(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
sendEvent(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
return new PumpEnactResult(injector).success(true).enacted(true);
}
@ -612,9 +613,11 @@ public class AapsOmnipodManager {
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
sendEvent(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
addSuccessToHistory(PodHistoryEntryType.SET_TIME, null);
sendEvent(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
sendEvent(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
return new PumpEnactResult(injector).success(true).enacted(true);
}