diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-13 02:12:12 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-13 02:14:58 +0200 |
commit | 871712ad62bb01359c29713a148a5673e26df1a8 (patch) | |
tree | 960aa794fb46b9c8050a35fa369e1bcc14e84e1c /android | |
parent | 307913304a7636d69fe6847a13c20aa7d9729e01 (diff) |
Don't return from the CommunicationService.run() method
This fixes connecting to one computer after connecting to another failed.
Change-Id: I5b13d186d32690a91e4290c81c8d2e12a0a1f2be
Diffstat (limited to 'android')
-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(); |