From 874915e7b412fb3c046492d6a46b4c8a6b0ed8d6 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 7 Dec 2017 12:30:58 +0100 Subject: [PATCH 1/2] adapt wear actions to command queue --- .../androidaps/plugins/Wear/ActionStringHandler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 6511cedbdf..da01d2103e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -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 dummies = new LinkedList(); List 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) From 21f91b9b29168c02c4abacf56e8f86e424a1e9eb Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Fri, 8 Dec 2017 14:58:13 +0100 Subject: [PATCH 2/2] remove unused imports --- .../androidaps/plugins/Wear/ActionStringHandler.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index da01d2103e..db94fbe740 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -1,9 +1,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; @@ -27,7 +25,6 @@ import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.interfaces.APSInterface; -import info.nightscout.androidaps.interfaces.DanaRInterface; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.ProfileInterface; import info.nightscout.androidaps.interfaces.PumpInterface;