mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-27 13:13:43 +00:00
Try to run IncomingMessageObserver more aggressively.
This commit is contained in:
@@ -175,6 +175,12 @@ class IncomingMessageObserver(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
authWebSocket.addKeepAliveChangeListener {
|
||||
lock.withLock {
|
||||
connectionNecessarySemaphore.release()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun notifyRegistrationStateChanged() {
|
||||
@@ -236,12 +242,12 @@ class IncomingMessageObserver(
|
||||
|
||||
val needsConnectionString = if (conclusion) "Needs Connection" else "Does Not Need Connection"
|
||||
|
||||
Log.d(TAG, "[$needsConnectionString] Network: $hasNetwork, Foreground: $appVisibleSnapshot, Time Since Last Interaction: $lastInteractionString, FCM: $fcmEnabled, WS Connected: $websocketAlreadyOpen, Registered: $registered, Proxy: $hasProxy, Force websocket: $forceWebsocket")
|
||||
Log.d(TAG, "[$needsConnectionString] Network: $hasNetwork, Foreground: $appVisibleSnapshot, Time Since Last Interaction: $lastInteractionString, FCM: $fcmEnabled, WS Open or Keep-alives: $websocketAlreadyOpen, Registered: $registered, Proxy: $hasProxy, Force websocket: $forceWebsocket")
|
||||
return conclusion
|
||||
}
|
||||
|
||||
private fun isConnectionAvailable(): Boolean {
|
||||
return authWebSocket.stateSnapshot == WebSocketConnectionState.CONNECTED
|
||||
return authWebSocket.stateSnapshot == WebSocketConnectionState.CONNECTED || authWebSocket.shouldSendKeepAlives()
|
||||
}
|
||||
|
||||
private fun waitForConnectionNecessary() {
|
||||
|
||||
@@ -74,7 +74,7 @@ class SignalWebSocketHealthMonitor(
|
||||
.distinctUntilChanged()
|
||||
.subscribeBy { onStateChanged(it) }
|
||||
|
||||
webSocket.keepAliveChangedListener = { executor.execute(this::updateKeepAliveSenderStatus) }
|
||||
webSocket.addKeepAliveChangeListener { executor.execute(this::updateKeepAliveSenderStatus) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user