Fix internet access status

This commit is contained in:
sim 2023-03-22 21:31:17 +01:00
parent d4870c39ad
commit 1628a4e718
1 changed files with 5 additions and 2 deletions

View File

@ -33,11 +33,14 @@ class RestartNetworkCallback(val context: Context) : ConnectivityManager.Network
RestartWorker.run(context, delay = 0) RestartWorker.run(context, delay = 0)
} // else, it retries in max 2sec } // else, it retries in max 2sec
} }
} else {
hasInternet = false
} }
} }
override fun onLost(network: Network) {
Log.d(TAG, "Network unavailable")
hasInternet = false
}
fun register() { fun register() {
if (!registered) { if (!registered) {
registered = true registered = true