fix profile test in keep alive & korean driver switching

This commit is contained in:
Milos Kozak 2017-01-29 19:17:28 +01:00
parent 3a17ed19c4
commit e608bf4095
3 changed files with 7 additions and 1 deletions

View file

@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
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.DanaRPump;
import info.nightscout.androidaps.plugins.DanaR.SerialIOThread;
@ -226,6 +227,8 @@ public class ExecutionService extends Service {
if (!getPumpStatus()) {
mSerialIOThread.disconnect("getPumpStatus failed");
waitMsec(3000);
if (!MainApp.getSpecificPlugin(DanaRPlugin.class).isEnabled(PluginBase.PUMP))
return;
getBTSocketForSelectedPump();
}
}

View file

@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventInitializationChanged;
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.MsgBolusProgress;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgBolusStart;
@ -222,6 +223,8 @@ public class ExecutionService extends Service {
if (!getPumpStatus()) {
mSerialIOThread.disconnect("getPumpStatus failed");
waitMsec(3000);
if (!MainApp.getSpecificPlugin(DanaRKoreanPlugin.class).isEnabled(PluginBase.PUMP))
return;
getBTSocketForSelectedPump();
}
}

View file

@ -50,7 +50,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
isBasalOutdated = true;
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() {
@Override
public void run() {