From 28b80697f910525c7538561e712fd021cc3c68e6 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 22 Nov 2017 00:04:50 +0100 Subject: [PATCH] Make RuffyScripter.returnToRootMenu more robust. --- .../main/java/de/jotomo/ruffyscripter/RuffyScripter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 91a80c16e6..1e7b0b3b06 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -52,7 +52,7 @@ import de.jotomo.ruffyscripter.commands.SetTbrCommand; public class RuffyScripter implements RuffyCommands { private static final Logger log = LoggerFactory.getLogger(RuffyScripter.class); - public static final long DISCONNECT_TIME_OUT_MS = 2500; + private static final long DISCONNECT_TIME_OUT_MS = 2500; private IRuffyService ruffyService; @@ -226,7 +226,9 @@ public class RuffyScripter implements RuffyCommands { while (menuType != MenuType.MAIN_MENU && menuType != MenuType.STOP && menuType != MenuType.WARNING_OR_ERROR) { log.debug("Going back to main menu, currently at " + menuType); pressBackKey(); - waitForScreenUpdate(); + while(getCurrentMenu().getType() == menuType) { + waitForScreenUpdate(); + } menuType = getCurrentMenu().getType(); } }