diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java index b50b8c85f7..f737abbfbd 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java @@ -1,5 +1,7 @@ package de.jotomo.ruffyscripter.commands; +import android.os.SystemClock; + import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute; import org.monkey.d.ruffy.ruffy.driver.display.MenuType; import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime; @@ -67,7 +69,7 @@ public class SetTbrCommand implements Command { retries--; if(retries==0) throw new CommandException().message("not able to find TBR_MENU: stuck in "+scripter.currentMenu); - Thread.sleep(500); + SystemClock.sleep(500); if(scripter.currentMenu.getType()== TBR_MENU) break; } @@ -82,7 +84,7 @@ public class SetTbrCommand implements Command { retries--; if(retries==0) throw new CommandException().message("not able to find TBR_SET: stuck in "+scripter.currentMenu); - Thread.sleep(500); + SystemClock.sleep(500); if(scripter.currentMenu.getType()== TBR_SET) break; if(scripter.currentMenu.getType()== TBR_DURATION) @@ -145,7 +147,7 @@ public class SetTbrCommand implements Command { retries--; if (retries == 0) throw new CommandException().message("not able to find TBR_SET: stuck in " + scripter.currentMenu); - Thread.sleep(500); + SystemClock.sleep(500); if (scripter.currentMenu.getType() == TBR_DURATION) break; if (scripter.currentMenu.getType() == TBR_SET) { 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 b276c23594..696c87ba2d 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 @@ -209,10 +209,7 @@ public class ComboPlugin implements PluginBase, PumpInterface { ruffyScripter.stop(); log.debug("ruffy service disconnected"); if(!keepUnbound) { - try { - Thread.sleep(250); - } catch (Exception e) { - } + SystemClock.sleep(250); bindRuffyService(); } }