Bugfix: sleep *inside* the loop.

Whops, maxing out a core, draining the battery.
This commit is contained in:
Johannes Mockenhaupt 2017-07-22 17:53:55 +02:00
parent fcd6f4ea0e
commit 9cdd988bff
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -61,7 +61,6 @@ public class RuffyScripter {
@Override @Override
public void run() { public void run() {
long lastDisconnect = System.currentTimeMillis(); long lastDisconnect = System.currentTimeMillis();
SystemClock.sleep(1000);
while (unrecoverableError == null) { while (unrecoverableError == null) {
try { try {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
@ -85,6 +84,7 @@ public class RuffyScripter {
} catch (RemoteException e) { } catch (RemoteException e) {
log.debug("Exception in idle disconnect monitor thread, carrying on", e); log.debug("Exception in idle disconnect monitor thread, carrying on", e);
} }
SystemClock.sleep(1000);
} }
} }
}, "idle-disconnect-monitor"); }, "idle-disconnect-monitor");