This commit is contained in:
sim 2023-08-31 21:42:46 +02:00
parent 3e7900da61
commit 95270c0e44
5 changed files with 16 additions and 12 deletions

View File

@ -15,6 +15,7 @@ object FailureHandler {
private val ttlFails = AtomicInteger(0)
private val nFails = AtomicInteger(0)
private val nFailsBeforePing = AtomicInteger(0)
// This is the last eventSource opened
private val eventSource: AtomicReference<EventSource?> = AtomicReference(null)

View File

@ -50,11 +50,14 @@ class RestartNetworkCallback(val context: Context) : ConnectivityManager.Network
} ?: run {
Log.d(TAG, "Registering new ConnectivityManager")
try {
connectivityManager.set((
context.getSystemService(Service.CONNECTIVITY_SERVICE) as ConnectivityManager
connectivityManager.set(
(
context.getSystemService(Service.CONNECTIVITY_SERVICE)
as ConnectivityManager
).apply {
registerDefaultNetworkCallback(this@RestartNetworkCallback)
})
}
)
} catch (e: Exception) {
e.printStackTrace()
}

View File

@ -41,7 +41,7 @@ open class AppNotification(
private val context: Context,
private val notificationId: Int,
private val notificationData: NotificationData,
private val channelData: ChannelData,
private val channelData: ChannelData
) {
private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {