Use SystemClock.sleep() instead of Thread.sleep() throughout.
This commit is contained in:
parent
306a2787d0
commit
2f3d362240
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue