RuffyScripter.isConnected: longer wait.

Declare the connection dead if no menu update was sent within 10s.
Occassionally it takes up 4s for regular updates to come in (possibly
due to other busy background threads? Iob/Cob calc is suspiscously
often running when the error occurs).
With the previous timeout, commands were killed too early when
things (pump, ruffy, aaps ...) needed some time to think).
This commit is contained in:
Johannes Mockenhaupt 2018-01-04 11:05:19 +01:00
parent 2d769ccf9a
commit 9457fb61e5
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -187,10 +187,7 @@ public class RuffyScripter implements RuffyCommands {
if (!ruffyService.isConnected()) {
return false;
}
if (System.currentTimeMillis() - menuLastUpdated >= 1500) {
waitForScreenUpdate();
}
return System.currentTimeMillis() - menuLastUpdated < 1500;
return ruffyService.isConnected() && System.currentTimeMillis() - menuLastUpdated < 10 * 1000;
} catch (RemoteException e) {
return false;
}