Index: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
index f5ce54ad8299adfd6df49443fd105b263ca1f871..0c1b78d72231e74efa35dfe16e2b5b278b1a40ab 100644 |
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
@@ -206,9 +206,20 @@ public class JniInterface { |
/** Reports whenever the connection status changes. Called on the UI thread. */ |
@CalledByNative |
- private static void reportConnectionStatus(int state, int error) { |
- sConnectionListener.onConnectionState(ConnectionListener.State.fromValue(state), |
- ConnectionListener.Error.fromValue(error)); |
+ private static void reportConnectionStatus(int stateCode, int errorCode) { |
+ ConnectionListener.State state = ConnectionListener.State.fromValue(stateCode); |
+ ConnectionListener.Error error = ConnectionListener.Error.fromValue(errorCode); |
+ switch (state) { |
Sergey Ulanov
2014/07/24 02:47:02
Don't really need switch statement here. if would
Lambros
2014/07/26 00:42:35
Done.
|
+ case FAILED: |
+ case CLOSED: |
+ // Clear the flag here, otherwise the next time connectToHost() is called, it will |
+ // try to disconnect, triggering an incorrect status notification. |
+ sConnected = false; |
+ break; |
+ default: |
+ break; |
+ } |
+ sConnectionListener.onConnectionState(state, error); |
} |
/** Prompts the user to enter a PIN. Called on the UI thread. */ |