Use SystemClock.sleep() instead of Thread.sleep() throughout.
This commit is contained in:
parent
306a2787d0
commit
2f3d362240
2 changed files with 6 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
||||||
package de.jotomo.ruffyscripter.commands;
|
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.MenuAttribute;
|
||||||
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
|
||||||
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime;
|
import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime;
|
||||||
|
@ -67,7 +69,7 @@ public class SetTbrCommand implements Command {
|
||||||
retries--;
|
retries--;
|
||||||
if(retries==0)
|
if(retries==0)
|
||||||
throw new CommandException().message("not able to find TBR_MENU: stuck in "+scripter.currentMenu);
|
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)
|
if(scripter.currentMenu.getType()== TBR_MENU)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +84,7 @@ public class SetTbrCommand implements Command {
|
||||||
retries--;
|
retries--;
|
||||||
if(retries==0)
|
if(retries==0)
|
||||||
throw new CommandException().message("not able to find TBR_SET: stuck in "+scripter.currentMenu);
|
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)
|
if(scripter.currentMenu.getType()== TBR_SET)
|
||||||
break;
|
break;
|
||||||
if(scripter.currentMenu.getType()== TBR_DURATION)
|
if(scripter.currentMenu.getType()== TBR_DURATION)
|
||||||
|
@ -145,7 +147,7 @@ public class SetTbrCommand implements Command {
|
||||||
retries--;
|
retries--;
|
||||||
if (retries == 0)
|
if (retries == 0)
|
||||||
throw new CommandException().message("not able to find TBR_SET: stuck in " + scripter.currentMenu);
|
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)
|
if (scripter.currentMenu.getType() == TBR_DURATION)
|
||||||
break;
|
break;
|
||||||
if (scripter.currentMenu.getType() == TBR_SET) {
|
if (scripter.currentMenu.getType() == TBR_SET) {
|
||||||
|
|
|
@ -209,10 +209,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
ruffyScripter.stop();
|
ruffyScripter.stop();
|
||||||
log.debug("ruffy service disconnected");
|
log.debug("ruffy service disconnected");
|
||||||
if(!keepUnbound) {
|
if(!keepUnbound) {
|
||||||
try {
|
SystemClock.sleep(250);
|
||||||
Thread.sleep(250);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
bindRuffyService();
|
bindRuffyService();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue