From 9fcec28970a34b5acd4a2daac6be3e666c2ed176 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Thu, 29 Aug 2019 21:21:02 +0200 Subject: [PATCH] Return PumpEnactResult on success in OmnipodManager --- .../plugins/pump/omnipod/OmnipodManager.java | 30 +++++++++---------- .../pump/omnipod/OmnipodPumpPlugin.java | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java index 8d49c07eb2..f2fc770606 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java @@ -83,7 +83,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -109,7 +109,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -126,7 +126,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -145,7 +145,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -164,7 +164,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -183,7 +183,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -191,7 +191,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { podState = null; SP.remove(OmnipodConst.Prefs.PodState); - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -208,7 +208,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -227,7 +227,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -244,7 +244,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } @Override @@ -260,7 +260,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { // TODO user friendly error messages (string resources) return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } // TODO should we add this to the OmnipodCommunicationManager interface? @@ -278,7 +278,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } // TODO should we add this to the OmnipodCommunicationManager interface? @@ -295,7 +295,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } // TODO should we add this to the OmnipodCommunicationManager interface? @@ -313,7 +313,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } // TODO should we add this to the OmnipodCommunicationManager interface? @@ -339,7 +339,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(false).enacted(false); } - return null; // TODO + return new PumpEnactResult().success(true).enacted(true); } public OmnipodCommunicationService getCommunicationService() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 071f2230bb..3f6b2b60f8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -478,6 +478,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa long time = System.currentTimeMillis() + (bolusTime * 1000); this.busyTimestamps.add(time); + result.bolusDelivered(detailedBolusInfo.insulin).carbsDelivered(detailedBolusInfo.carbs); } return result;