Use SystemClock.sleep() instead of Thread.sleep() throughout.

This commit is contained in:
Johannes Mockenhaupt 2017-08-12 13:36:09 +02:00
parent 306a2787d0
commit 2f3d362240
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 6 additions and 7 deletions

View file

@ -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) {

View file

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