mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-18 05:01:28 +00:00
6e1114d4d8
By using networkMonitor.isOnline.first() the function unregisterNetworkCallback was triggered, which sometimes causes the ConnectivityManager$TooManyRequestsException. So each time isOnline.first() was called, the callbackFlow would: - Register a new NetworkCallback. - Emit a value and cancel the flow. - Unregister the NetworkCallback. The exception was: Exception android.net.ConnectivityManager$TooManyRequestsException: at android.net.ConnectivityManager.convertServiceException (ConnectivityManager.java:3771) at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3960) at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3967) at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4349) at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4319) at com.nextcloud.talk.data.network.NetworkMonitorImpl$isOnline$1.invokeSuspend (NetworkMonitorImpl.kt:61) To fix this, the cold flow from callbackFlow is converted to a StateFlow. Signed-off-by: Marcel Hibbe <dev@mhibbe.de> |
||
---|---|---|
.. | ||
schemas/com.nextcloud.talk.data.source.local.TalkDatabase | ||
src | ||
build.gradle | ||
lint.xml | ||
proguard-rules.pro |