diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java index b18b09c0d0..8d4a763408 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java @@ -11,6 +11,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; +import info.nightscout.androidaps.Config; + public class BolusCommand extends BaseCommand { private static final Logger log = LoggerFactory.getLogger(BolusCommand.class); @@ -96,9 +98,20 @@ public class BolusCommand extends BaseCommand { } log.debug("Bolus record in history confirms delivered bolus"); - // leave menu to go back to main menu - scripter.pressCheckKey(); - scripter.waitForMenuToBeLeft(MenuType.BOLUS_DATA); + if (Config.comboExperimentalFeatures) { + // returning to main menu using the 'back' key should not cause a vibration + // TODO this is too brute-force; at least check for WARNING_OR_ERROR menu type + do { + log.debug("Going back to main menu, currently at " + scripter.getCurrentMenu().getType()); + scripter.pressBackKey(); + scripter.waitForMenuUpdate(); + } while (scripter.getCurrentMenu().getType() != MenuType.MAIN_MENU); + } else { + // leave menu to go back to main menu + scripter.pressCheckKey(); + scripter.waitForMenuToBeLeft(MenuType.BOLUS_DATA); + } + scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU, "Bolus was correctly delivered and checked against history, but we " + "did not return the main menu successfully."); diff --git a/app/src/main/java/info/nightscout/androidaps/Config.java b/app/src/main/java/info/nightscout/androidaps/Config.java index b8ab7ed8dd..7194b49709 100644 --- a/app/src/main/java/info/nightscout/androidaps/Config.java +++ b/app/src/main/java/info/nightscout/androidaps/Config.java @@ -49,11 +49,14 @@ public class Config { public static final boolean logDanaSerialEngine = true; // Combo specific + // TODO try turning this into preferences + public static final boolean comboExperimentalFeatures = true; + /** enable the UNFINISHED and currently BROKEN bolus cammand that reports progress and can be cancelled */ - public static final boolean comboExperimentalBolus = false; + public static final boolean comboExperimentalBolus = false && comboExperimentalFeatures; /** Very quick hack to split up bolus into 2 U parts, spaced roughly 45s apart. * If there's an error during bolusing, no record is created in AAPS. * Don't combine with experimental bolus! */ - public static final boolean comboExperimentalSplitBoluses = false && !comboExperimentalBolus; + public static final boolean comboExperimentalSplitBoluses = false && comboExperimentalFeatures && !comboExperimentalBolus; }