From 14d704360037bbbbccf1523e749542f78ad48de3 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Tue, 18 Jul 2017 18:25:59 +0200 Subject: [PATCH] Skip fetching initial pump state if ruffy service isn't ready yet. --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 346a51784d..ea13de86e8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -296,6 +296,12 @@ public class ComboPlugin implements PluginBase, PumpInterface { public void refreshDataFromPump(String reason) { log.debug("RefreshDataFromPump called"); + // if Android is sluggish this might get called before ruffy is bound + if (ruffyScripter == null) { + log.debug("Rejecting call to RefreshDataFromPump: ruffy service not bound yet"); + return; + } + if (!reason.toLowerCase().contains("user") && lastCmdTime.getTime() > 0 && System.currentTimeMillis() > lastCmdTime.getTime() + 60 * 1000) {