Only return valid entries in light mode

This commit is contained in:
Mygod
2020-06-22 10:05:12 +08:00
parent 012f1a1627
commit debbf7a4ce
6 changed files with 38 additions and 37 deletions

View File

@@ -18,7 +18,7 @@ abstract class IpNeighbourMonitoringService : Service(), IpNeighbourMonitor.Call
protected fun updateNotification() {
val sizeLookup = neighbours.groupBy { it.dev }.mapValues { (_, neighbours) ->
neighbours
.filter { it.ip is Inet4Address && it.state != IpNeighbour.State.FAILED }
.filter { it.ip is Inet4Address && it.state == IpNeighbour.State.VALID }
.distinctBy { it.lladdr }
.size
}