Commit 85c02cc3 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add new connection state SESSION_ESTABLISHED

parent ef3afda1
...@@ -28,4 +28,6 @@ public interface ConnectivityManagerApi { ...@@ -28,4 +28,6 @@ public interface ConnectivityManagerApi {
int getConnectivityState(@NonNull String hostname); int getConnectivityState(@NonNull String hostname);
void resetConnectivityStateList(); void resetConnectivityStateList();
void notifySessionEstablished(String hostname);
} }
...@@ -136,6 +136,13 @@ import io.reactivex.subjects.BehaviorSubject; ...@@ -136,6 +136,13 @@ import io.reactivex.subjects.BehaviorSubject;
return list; return list;
} }
@Override
public void notifySessionEstablished(String hostname) {
serverConnectivityList.put(hostname, ServerConnectivity.STATE_SESSION_ESTABLISHED);
connectivitySubject.onNext(
new ServerConnectivity(hostname, ServerConnectivity.STATE_SESSION_ESTABLISHED));
}
@DebugLog @DebugLog
@Override @Override
public void notifyConnectionEstablished(String hostname, String session) { public void notifyConnectionEstablished(String hostname, String session) {
......
...@@ -6,10 +6,10 @@ package chat.rocket.android.service; ...@@ -6,10 +6,10 @@ package chat.rocket.android.service;
public class ServerConnectivity { public class ServerConnectivity {
public static final int STATE_CONNECTED = 1; public static final int STATE_CONNECTED = 1;
public static final int STATE_DISCONNECTED = 2; public static final int STATE_DISCONNECTED = 2;
public static final int STATE_CONNECTING = 3; public static final int STATE_CONNECTING = 3;
/*package*/ static final int STATE_DISCONNECTING = 4; /*package*/ static final int STATE_DISCONNECTING = 4;
public static final int STATE_SESSION_ESTABLISHED = 5;
public static final ServerConnectivity CONNECTED = new ServerConnectivity(null, STATE_CONNECTED); public static final ServerConnectivity CONNECTED = new ServerConnectivity(null, STATE_CONNECTED);
public final String hostname; public final String hostname;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment