mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Improve auth WebSocket lifecycle.
This commit is contained in:
committed by
Alex Hart
parent
6bbd899507
commit
323697dfc9
@@ -5,6 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.whispersystems.signalservice.api.websocket.SignalWebSocket;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -50,11 +51,13 @@ public final class DeviceTransferBlockingInterceptor implements Interceptor {
|
||||
|
||||
public void blockNetwork() {
|
||||
blockNetworking = true;
|
||||
SignalWebSocket.setCanConnect(false);
|
||||
AppDependencies.resetNetwork();
|
||||
}
|
||||
|
||||
public void unblockNetwork() {
|
||||
blockNetworking = false;
|
||||
SignalWebSocket.setCanConnect(true);
|
||||
AppDependencies.startNetwork();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class SignalWebSocketHealthMonitor(
|
||||
}
|
||||
|
||||
private fun sendKeepAlives(): Boolean {
|
||||
return needsKeepAlive && webSocket?.shouldSendKeepAlives == true
|
||||
return needsKeepAlive && webSocket?.shouldSendKeepAlives() == true
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user