- added SP to OmnipodUtil
This commit is contained in:
parent
7fa1ebfe38
commit
7db7e07a70
1 changed files with 8 additions and 5 deletions
|
@ -31,8 +31,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionStat
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodDriverState;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodDriverState;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange;
|
import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange;
|
||||||
import info.nightscout.androidaps.utils.SP;
|
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog;
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog;
|
||||||
|
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by andy on 4/8/19.
|
* Created by andy on 4/8/19.
|
||||||
|
@ -45,6 +45,7 @@ public class OmnipodUtil {
|
||||||
private final RileyLinkUtil rileyLinkUtil;
|
private final RileyLinkUtil rileyLinkUtil;
|
||||||
private final OmnipodPumpStatus omnipodPumpStatus;
|
private final OmnipodPumpStatus omnipodPumpStatus;
|
||||||
private final ActivePluginProvider activePlugins;
|
private final ActivePluginProvider activePlugins;
|
||||||
|
private final SP sp;
|
||||||
|
|
||||||
private boolean lowLevelDebug = true;
|
private boolean lowLevelDebug = true;
|
||||||
private OmnipodCommandType currentCommand;
|
private OmnipodCommandType currentCommand;
|
||||||
|
@ -61,12 +62,14 @@ public class OmnipodUtil {
|
||||||
RxBusWrapper rxBus,
|
RxBusWrapper rxBus,
|
||||||
RileyLinkUtil rileyLinkUtil,
|
RileyLinkUtil rileyLinkUtil,
|
||||||
OmnipodPumpStatus omnipodPumpStatus,
|
OmnipodPumpStatus omnipodPumpStatus,
|
||||||
|
SP sp,
|
||||||
ActivePluginProvider activePlugins
|
ActivePluginProvider activePlugins
|
||||||
) {
|
) {
|
||||||
this.aapsLogger = aapsLogger;
|
this.aapsLogger = aapsLogger;
|
||||||
this.rxBus = rxBus;
|
this.rxBus = rxBus;
|
||||||
this.rileyLinkUtil = rileyLinkUtil;
|
this.rileyLinkUtil = rileyLinkUtil;
|
||||||
this.omnipodPumpStatus = omnipodPumpStatus;
|
this.omnipodPumpStatus = omnipodPumpStatus;
|
||||||
|
this.sp = sp;
|
||||||
this.activePlugins = activePlugins;
|
this.activePlugins = activePlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,8 +195,8 @@ public class OmnipodUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getNextPodAddress() {
|
public Integer getNextPodAddress() {
|
||||||
if(SP.contains(OmnipodConst.Prefs.NextPodAddress)) {
|
if(sp.contains(OmnipodConst.Prefs.NextPodAddress)) {
|
||||||
int nextPodAddress = SP.getInt(OmnipodConst.Prefs.NextPodAddress, 0);
|
int nextPodAddress = sp.getInt(OmnipodConst.Prefs.NextPodAddress, 0);
|
||||||
if (OmnipodManager.isValidAddress(nextPodAddress)) {
|
if (OmnipodManager.isValidAddress(nextPodAddress)) {
|
||||||
return nextPodAddress;
|
return nextPodAddress;
|
||||||
}
|
}
|
||||||
|
@ -206,10 +209,10 @@ public class OmnipodUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNextPodAddress(int address) {
|
public void setNextPodAddress(int address) {
|
||||||
SP.putInt(OmnipodConst.Prefs.NextPodAddress, address);
|
sp.putInt(OmnipodConst.Prefs.NextPodAddress, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeNextPodAddress() {
|
public void removeNextPodAddress() {
|
||||||
SP.remove(OmnipodConst.Prefs.NextPodAddress);
|
sp.remove(OmnipodConst.Prefs.NextPodAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue