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

@@ -129,7 +129,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService(), CoroutineScope {
override fun onIpNeighbourAvailable(neighbours: Collection<IpNeighbour>) {
super.onIpNeighbourAvailable(neighbours)
if (Build.VERSION.SDK_INT >= 28) timeoutMonitor?.onClientsChanged(neighbours.none {
it.ip is Inet4Address && it.state != IpNeighbour.State.FAILED
it.ip is Inet4Address && it.state == IpNeighbour.State.VALID
})
}