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) omnipod_pod_status.text = resourceHelper.gs(R.string.omnipod_pod_not_initalized)
omnipodPumpStatus.podAvailable = false omnipodPumpStatus.podAvailable = false
omnipodPumpStatus.podNumber == null 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_address.text = resourceHelper.gs(R.string.omnipod_pod_name_no_info)
omnipod_pod_lot.text = "-" omnipod_pod_lot.text = "-"
omnipod_pod_tid.text = "-" omnipod_pod_tid.text = "-"

View file

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