From 3db7aedb06afad16ab19fed74fde636af4113985 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 31 Jan 2018 00:09:38 +0100 Subject: [PATCH] Fix activity indicator during on-connect-checks. --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 64dd7a6661..6a34805bd9 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 @@ -735,17 +735,15 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf /** * Runs a command, sets an activity if provided, retries if requested and updates fields * concerned with last connection. - * NO history, reservoir level fields are updated, this make be done separately if desired. + * Local cache (history, reservoir level, pump state) are updated via #updateLocalData() + * if returned by a command. */ private synchronized CommandResult runCommand(String activity, int retries, CommandExecution commandExecution) { CommandResult commandResult; try { - if (activity != null) { - pump.activity = activity; - MainApp.bus().post(new EventComboPumpUpdateGUI()); - } - if (!ruffyScripter.isConnected()) { + pump.activity = MainApp.gs(R.string.combo_activity_checking_pump_state); + MainApp.bus().post(new EventComboPumpUpdateGUI()); CommandResult preCheckError = runOnConnectChecks(); if (preCheckError != null) { updateLocalData(preCheckError); @@ -753,6 +751,11 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf } } + if (activity != null) { + pump.activity = activity; + MainApp.bus().post(new EventComboPumpUpdateGUI()); + } + commandResult = commandExecution.execute(); if (!commandResult.success && retries > 0) {