Restore accidentally removed code

This commit is contained in:
Bart Sopers 2020-08-09 14:04:24 +02:00
parent 62bda451a0
commit 050816ddf9
2 changed files with 13 additions and 12 deletions

View file

@ -254,7 +254,7 @@ class OmnipodFragment : DaggerFragment() {
omnipod_pod_status.text = resourceHelper.gs(R.string.omnipod_pod_not_initalized)
omnipodPumpStatus.podAvailable = false
omnipodPumpStatus.podNumber == null
} else if (driverState == OmnipodDriverState.Initalized_NoPod || !omnipodPumpStatus.podStateManager.hasState()) {
} else if (driverState == OmnipodDriverState.Initalized_NoPod) {
omnipod_pod_address.text = resourceHelper.gs(R.string.omnipod_pod_name_no_info)
omnipod_pod_lot.text = "-"
omnipod_pod_tid.text = "-"

View file

@ -622,20 +622,21 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
setRefreshButtonEnabled(false);
try {
PodStateManager podStateManager = omnipodUtil.getPodStateManager();
} catch(Exception ex) {
PodStateManager podStateManager = omnipodUtil.getPodStateManager();
if (podStateManager.isPaired()) {
aapsLogger.debug(LTag.PUMP, "PodStateManager (saved): " + podStateManager);
if (!isRefresh) {
pumpState = PumpDriverState.Initialized;
}
// TODO handle if session state too old
getPodPumpStatus();
} else {
aapsLogger.debug(LTag.PUMP, "No Pod running");
omnipodUtil.setDriverState(OmnipodDriverState.Initalized_NoPod);
throw ex;
}
if (!isRefresh) {
pumpState = PumpDriverState.Initialized;
}
// TODO handle if pod state too old
getPodPumpStatus();
finishAction("Omnipod Pump");
// if (!sentIdToFirebase) {