Restart service on network capabilities changed

This commit is contained in:
sim 2022-01-17 20:58:47 +01:00
parent 31cf3fb21a
commit 52a956464a
1 changed files with 6 additions and 2 deletions

View File

@ -121,8 +121,12 @@ class StartService: Service(){
startListener(this@StartService)
}
override fun onLost(network: Network) {
Log.d(TAG, "Network is DISCONNECTED")
override fun onCapabilitiesChanged(
network: Network,
networkCapabilities: NetworkCapabilities
) {
Log.d(TAG, "Network Capabilities changed")
startListener(this@StartService)
}
})
} catch (e: Exception) {