Return PumpEnactResult on success in OmnipodManager

This commit is contained in:
Bart Sopers 2019-08-29 21:21:02 +02:00
parent 83d95f1e87
commit 9fcec28970
2 changed files with 16 additions and 15 deletions

View file

@ -83,7 +83,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -109,7 +109,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -126,7 +126,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -145,7 +145,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -164,7 +164,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -183,7 +183,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -191,7 +191,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
podState = null; podState = null;
SP.remove(OmnipodConst.Prefs.PodState); SP.remove(OmnipodConst.Prefs.PodState);
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -208,7 +208,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -227,7 +227,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -244,7 +244,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
return new PumpEnactResult().success(false).enacted(false); return new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
@Override @Override
@ -260,7 +260,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface {
// TODO user friendly error messages (string resources) // TODO user friendly error messages (string resources)
return new PumpEnactResult().success(false).enacted(false); 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? // 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 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? // 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 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? // 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 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? // 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 new PumpEnactResult().success(false).enacted(false);
} }
return null; // TODO return new PumpEnactResult().success(true).enacted(true);
} }
public OmnipodCommunicationService getCommunicationService() { public OmnipodCommunicationService getCommunicationService() {

View file

@ -478,6 +478,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa
long time = System.currentTimeMillis() + (bolusTime * 1000); long time = System.currentTimeMillis() + (bolusTime * 1000);
this.busyTimestamps.add(time); this.busyTimestamps.add(time);
result.bolusDelivered(detailedBolusInfo.insulin).carbsDelivered(detailedBolusInfo.carbs);
} }
return result; return result;