Knit in OmnipodManager

This commit is contained in:
Bart Sopers 2019-12-08 17:47:36 +01:00
parent c5f69347eb
commit 2905bfba86

View file

@ -200,6 +200,10 @@ public class OmnipodManager {
SingleSubject<BolusDeliveryResult> bolusCompletionSubject = SingleSubject.create();
synchronized (bolusDataLock) {
activeBolusData = new ActiveBolusData(units, startDate, bolusCompletionSubject, disposables);
}
disposables.add(Completable.complete() //
.delay(estimatedRemainingBolusDuration.getMillis() + 250, TimeUnit.MILLISECONDS) //
.observeOn(AndroidSchedulers.mainThread()) //
@ -229,10 +233,6 @@ public class OmnipodManager {
})
.subscribe());
synchronized (bolusDataLock) {
activeBolusData = new ActiveBolusData(units, startDate, bolusCompletionSubject, disposables);
}
return new BolusCommandResult(commandDeliveryStatus, bolusCompletionSubject);
}