Fix a race condition
This commit is contained in:
@@ -15,7 +15,7 @@ abstract class IpNeighbourMonitoringService : Service(), IpNeighbourMonitor.Call
|
||||
this.neighbours = neighbours
|
||||
updateNotification()
|
||||
}
|
||||
protected fun updateNotification() {
|
||||
protected open fun updateNotification() {
|
||||
val sizeLookup = neighbours.groupBy { it.dev }.mapValues { (_, neighbours) ->
|
||||
neighbours
|
||||
.filter { it.ip is Inet4Address && it.state == IpNeighbour.State.VALID }
|
||||
|
||||
@@ -155,4 +155,8 @@ class TetheringService : IpNeighbourMonitoringService(), TetheringManager.Tether
|
||||
callbackRegistered = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateNotification() {
|
||||
launch { super.updateNotification() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user