Fix up "Rebind ruffy if there is an exception.".
Some removals, but more importantly to note that the commit set pump/command state variables volatile again.
This commit is contained in:
parent
5c36094b8b
commit
29cb1def50
|
@ -126,9 +126,12 @@ public class ComboFragment extends Fragment implements View.OnClickListener {
|
||||||
if (getPlugin().lastCmd != null) {
|
if (getPlugin().lastCmd != null) {
|
||||||
lastCmdText.setText("" + getPlugin().lastCmd);
|
lastCmdText.setText("" + getPlugin().lastCmd);
|
||||||
lastCmdTimeText.setText(getPlugin().lastCmdTime.toLocaleString());
|
lastCmdTimeText.setText(getPlugin().lastCmdTime.toLocaleString());
|
||||||
if (getPlugin().lastCmdResult != null) {
|
CommandResult lastCmdResult = getPlugin().lastCmdResult;
|
||||||
String message = getPlugin().lastCmdResult.message;
|
if (lastCmdResult != null) {
|
||||||
|
String message = lastCmdResult.message;
|
||||||
lastCmdResultText.setText(message != null ? message : "");
|
lastCmdResultText.setText(message != null ? message : "");
|
||||||
|
} else {
|
||||||
|
lastCmdResultText.setText("");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ComboFragment.this.lastCmdText.setText("");
|
ComboFragment.this.lastCmdText.setText("");
|
||||||
|
|
|
@ -8,7 +8,6 @@ import android.content.ServiceConnection;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.media.RingtoneManager;
|
import android.media.RingtoneManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.DeadObjectException;
|
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
@ -34,7 +33,6 @@ import de.jotomo.ruffyscripter.commands.ReadPumpStateCommand;
|
||||||
import de.jotomo.ruffyscripter.commands.SetTbrCommand;
|
import de.jotomo.ruffyscripter.commands.SetTbrCommand;
|
||||||
import de.jotomo.ruffyscripter.PumpState;
|
import de.jotomo.ruffyscripter.PumpState;
|
||||||
import info.nightscout.androidaps.BuildConfig;
|
import info.nightscout.androidaps.BuildConfig;
|
||||||
import info.nightscout.androidaps.Config;
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||||
|
@ -120,8 +118,6 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// give AAPS time to bootup, there's quit a lot going on
|
|
||||||
// SystemClock.sleep(60 * 1000);
|
|
||||||
Context context = MainApp.instance().getApplicationContext();
|
Context context = MainApp.instance().getApplicationContext();
|
||||||
NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
int id = 1000;
|
int id = 1000;
|
||||||
|
@ -499,7 +495,6 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
@Override
|
@Override
|
||||||
public PumpEnactResult cancelTempBasal() {
|
public PumpEnactResult cancelTempBasal() {
|
||||||
log.debug("cancelTempBasal called");
|
log.debug("cancelTempBasal called");
|
||||||
long tbrEnd = System.currentTimeMillis();
|
|
||||||
CommandResult commandResult = runCommand(new CancelTbrCommand());
|
CommandResult commandResult = runCommand(new CancelTbrCommand());
|
||||||
if (commandResult.enacted) {
|
if (commandResult.enacted) {
|
||||||
TemporaryBasal tempStop = new TemporaryBasal(commandResult.completionTime);
|
TemporaryBasal tempStop = new TemporaryBasal(commandResult.completionTime);
|
||||||
|
|
Loading…
Reference in a new issue