Fix internet access status
This commit is contained in:
parent
d4870c39ad
commit
1628a4e718
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue