diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-13 02:12:12 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-02-13 11:40:17 +0000 |
commit | 4ed9aa98519dee8927cad5e792a06578263390a5 (patch) | |
tree | a3eb9336fd7da524b54ce58cde78e37a6afe10f7 | |
parent | fa66259a2b3cf5454650ee388d7e93b67f5a69d5 (diff) |
Don't return from the CommunicationService.run() method
This fixes connecting to one computer after connecting to another failed.
Change-Id: I5b13d186d32690a91e4290c81c8d2e12a0a1f2be
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java index 5f8f8c6856b7..5b326612b313 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java @@ -76,6 +76,7 @@ public class CommunicationService extends Service implements Runnable { @Override public void run() { + Log.i(Globals.TAG, "CommunicationService.run()"); synchronized (this) { while (true) { // Condition @@ -86,6 +87,7 @@ public class CommunicationService extends Service implements Runnable { return; } // Work + Log.i(Globals.TAG, "CommunicationService.run: at \"Work\""); synchronized (mConnectionVariableMutex) { if ((mStateDesired == State.CONNECTED && mState == State.CONNECTED) || (mStateDesired == State.DISCONNECTED && mState == State.CONNECTED)) { @@ -107,23 +109,21 @@ public class CommunicationService extends Service implements Runnable { mBluetoothPreviouslyEnabled); break; } + mTransmitter = new Transmitter(mClient); + mState = State.CONNECTED; } catch (IOException e) { - e.printStackTrace(); + Log.i(Globals.TAG, "CommunicationService.run: " + e); mClient = null; mState = State.DISCONNECTED; Intent aIntent = new Intent( CommunicationService.STATUS_CONNECTION_FAILED); LocalBroadcastManager.getInstance(this) .sendBroadcast(aIntent); - return; } - mTransmitter = new Transmitter(mClient); - mState = State.CONNECTED; } } } } - } private boolean mBluetoothPreviouslyEnabled; @@ -156,6 +156,7 @@ public class CommunicationService extends Service implements Runnable { } public void connectTo(Server aServer) { + Log.i(Globals.TAG, "CommunicationService.connectTo(" + aServer + ")"); synchronized (mConnectionVariableMutex) { if (mState == State.SEARCHING) { mNetworkFinder.stopFinding(); |