Improve auth WebSocket lifecycle.

This commit is contained in:
Cody Henthorne
2025-03-18 13:38:21 -04:00
committed by Alex Hart
parent 6bbd899507
commit 323697dfc9
16 changed files with 300 additions and 205 deletions

View File

@@ -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();
}
}

View File

@@ -109,7 +109,7 @@ class SignalWebSocketHealthMonitor(
}
private fun sendKeepAlives(): Boolean {
return needsKeepAlive && webSocket?.shouldSendKeepAlives == true
return needsKeepAlive && webSocket?.shouldSendKeepAlives() == true
}
/**