Refine client counting

This commit is contained in:
Mygod
2019-07-20 18:23:07 +08:00
parent 0ab3ccf8d5
commit 69edebdaa9
2 changed files with 11 additions and 4 deletions

View File

@@ -134,7 +134,9 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService(), CoroutineScope {
override fun onIpNeighbourAvailable(neighbours: List<IpNeighbour>) {
super.onIpNeighbourAvailable(neighbours)
if (Build.VERSION.SDK_INT >= 28) timeoutMonitor?.onClientsChanged(neighbours.isEmpty())
if (Build.VERSION.SDK_INT >= 28) timeoutMonitor?.onClientsChanged(neighbours.none {
it.state != IpNeighbour.State.FAILED
})
}
override fun onDestroy() {