Restart service on network capabilities changed
This commit is contained in:
parent
31cf3fb21a
commit
52a956464a
|
@ -121,8 +121,12 @@ class StartService: Service(){
|
||||||
startListener(this@StartService)
|
startListener(this@StartService)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLost(network: Network) {
|
override fun onCapabilitiesChanged(
|
||||||
Log.d(TAG, "Network is DISCONNECTED")
|
network: Network,
|
||||||
|
networkCapabilities: NetworkCapabilities
|
||||||
|
) {
|
||||||
|
Log.d(TAG, "Network Capabilities changed")
|
||||||
|
startListener(this@StartService)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
Loading…
Reference in New Issue