From a1564d5bb72fdb555ca350c54738ba87a5be2674 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 19 Jul 2017 14:06:37 +0200 Subject: [PATCH] RuffyScripter: only set connected variable in rtConnected, rtDisconnected. Hopefully fixes intermittent failures to close the connection, as idleDisconnectMonitorThread sometimes fails to disconnect because connected == false. --- app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index dff3fed01e..caa157bfa3 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -70,7 +70,6 @@ public class RuffyScripter { // don't disconnect too frequently, confuses ruffy? && now > lastDisconnect + 15 * 1000) { log.debug("Disconnecting after " + (connectionTimeOutMs / 1000) + "s inactivity timeout"); - connected = false; lastDisconnect = now; ruffyService.doRTDisconnect(); SystemClock.sleep(1000); @@ -295,7 +294,6 @@ public class RuffyScripter { // waitForMenuUpdate times out after 60s and throws a CommandException waitForMenuUpdate(); } - connected = true; } catch (RemoteException e) { throw new CommandException().exception(e).message("Unexpected exception while initiating/restoring pump connection"); }