Make RuffyScripter.returnToRootMenu more robust.

This commit is contained in:
Johannes Mockenhaupt 2017-11-22 00:04:50 +01:00
parent a3fe804c3d
commit 28b80697f9
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -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();
}
}