fix profile test in keep alive & korean driver switching
This commit is contained in:
parent
3a17ed19c4
commit
e608bf4095
|
@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.events.EventAppExit;
|
import info.nightscout.androidaps.events.EventAppExit;
|
||||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||||
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.DanaRPlugin;
|
import info.nightscout.androidaps.plugins.DanaR.DanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.DanaRPump;
|
import info.nightscout.androidaps.plugins.DanaR.DanaRPump;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.SerialIOThread;
|
import info.nightscout.androidaps.plugins.DanaR.SerialIOThread;
|
||||||
|
@ -226,6 +227,8 @@ public class ExecutionService extends Service {
|
||||||
if (!getPumpStatus()) {
|
if (!getPumpStatus()) {
|
||||||
mSerialIOThread.disconnect("getPumpStatus failed");
|
mSerialIOThread.disconnect("getPumpStatus failed");
|
||||||
waitMsec(3000);
|
waitMsec(3000);
|
||||||
|
if (!MainApp.getSpecificPlugin(DanaRPlugin.class).isEnabled(PluginBase.PUMP))
|
||||||
|
return;
|
||||||
getBTSocketForSelectedPump();
|
getBTSocketForSelectedPump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.Treatment;
|
||||||
import info.nightscout.androidaps.events.EventAppExit;
|
import info.nightscout.androidaps.events.EventAppExit;
|
||||||
import info.nightscout.androidaps.events.EventInitializationChanged;
|
import info.nightscout.androidaps.events.EventInitializationChanged;
|
||||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||||
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.comm.MessageBase;
|
import info.nightscout.androidaps.plugins.DanaR.comm.MessageBase;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.comm.MsgBolusProgress;
|
import info.nightscout.androidaps.plugins.DanaR.comm.MsgBolusProgress;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.comm.MsgBolusStart;
|
import info.nightscout.androidaps.plugins.DanaR.comm.MsgBolusStart;
|
||||||
|
@ -222,6 +223,8 @@ public class ExecutionService extends Service {
|
||||||
if (!getPumpStatus()) {
|
if (!getPumpStatus()) {
|
||||||
mSerialIOThread.disconnect("getPumpStatus failed");
|
mSerialIOThread.disconnect("getPumpStatus failed");
|
||||||
waitMsec(3000);
|
waitMsec(3000);
|
||||||
|
if (!MainApp.getSpecificPlugin(DanaRKoreanPlugin.class).isEnabled(PluginBase.PUMP))
|
||||||
|
return;
|
||||||
getBTSocketForSelectedPump();
|
getBTSocketForSelectedPump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
|
||||||
isBasalOutdated = true;
|
isBasalOutdated = true;
|
||||||
|
|
||||||
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
if (SP.getBoolean("syncprofiletopump", false)) {
|
if (SP.getBoolean("syncprofiletopump", false) && !pump.isThisProfileSet(profile)) {
|
||||||
Thread t = new Thread(new Runnable() {
|
Thread t = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
Loading…
Reference in a new issue