adapt wear actions to command queue
This commit is contained in:
parent
dc3c853aca
commit
874915e7b4
|
@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.Wear;
|
|||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
|
@ -296,11 +297,10 @@ public class ActionStringHandler {
|
|||
rMessage += MainApp.instance().getString(R.string.pumpbusy);
|
||||
} else {
|
||||
rMessage += "trying to fetch data from pump.";
|
||||
Handler handler = new Handler(handlerThread.getLooper());
|
||||
handler.post(new Runnable() {
|
||||
|
||||
ConfigBuilderPlugin.getCommandQueue().loadHistory(RecordTypes.RECORD_TYPE_DAILY, new Callback() {
|
||||
@Override
|
||||
public void run() {
|
||||
((DanaRInterface) pump).loadHistory(RecordTypes.RECORD_TYPE_DAILY);
|
||||
List<DanaRHistoryRecord> dummies = new LinkedList<DanaRHistoryRecord>();
|
||||
List<DanaRHistoryRecord> historyList = getTDDList(dummies);
|
||||
if (isOldData(historyList)) {
|
||||
|
@ -308,8 +308,8 @@ public class ActionStringHandler {
|
|||
} else {
|
||||
sendStatusmessage("TDD", generateTDDMessage(historyList, dummies));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// if up to date: prepare, send (check if CPP is activated -> add CPP stats)
|
||||
|
|
Loading…
Reference in a new issue