mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 14:13:22 +01:00
Add UI support for configuring a proxy.
This commit is contained in:
@@ -9,13 +9,11 @@ import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketOption;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.net.SocketFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.whispersystems.signalservice.api.websocket;
|
||||
|
||||
|
||||
import okhttp3.Response;
|
||||
|
||||
public interface ConnectivityListener {
|
||||
void onConnected();
|
||||
void onConnecting();
|
||||
void onDisconnected();
|
||||
void onAuthenticationFailure();
|
||||
boolean onGenericFailure(Response response, Throwable throwable);
|
||||
}
|
||||
|
||||
@@ -304,7 +304,15 @@ public class WebSocketConnection extends WebSocketListener {
|
||||
Log.w(TAG, "onFailure()", t);
|
||||
|
||||
if (response != null && (response.code() == 401 || response.code() == 403)) {
|
||||
if (listener != null) listener.onAuthenticationFailure();
|
||||
if (listener != null) {
|
||||
listener.onAuthenticationFailure();
|
||||
}
|
||||
} else if (listener != null) {
|
||||
boolean shouldRetryConnection = listener.onGenericFailure(response, t);
|
||||
if (!shouldRetryConnection) {
|
||||
Log.w(TAG, "Experienced a failure, and the listener indicated we should not retry the connection. Disconnecting.");
|
||||
disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if (client != null) {
|
||||
|
||||
Reference in New Issue
Block a user