Fix deadlock/ANR in IncomingMessageObserver and SignalWebSOcket.

This commit is contained in:
Cody Henthorne
2025-06-26 10:32:16 -04:00
parent 5126b76214
commit 0947d5b7b5
2 changed files with 24 additions and 20 deletions

View File

@@ -155,11 +155,11 @@ class IncomingMessageObserver(
AppForegroundObserver.addListener(object : AppForegroundObserver.Listener {
override fun onForeground() {
onAppForegrounded()
SignalExecutors.BOUNDED.execute { onAppForegrounded() }
}
override fun onBackground() {
onAppBackgrounded()
SignalExecutors.BOUNDED.execute { onAppBackgrounded() }
}
})
@@ -177,8 +177,10 @@ class IncomingMessageObserver(
}
authWebSocket.addKeepAliveChangeListener {
lock.withLock {
connectionNecessarySemaphore.release()
SignalExecutors.BOUNDED.execute {
lock.withLock {
connectionNecessarySemaphore.release()
}
}
}
}