Auto detect prefix length as well

Unfortunately NetworkInterface requires INTERNET permission. (this can actually be bypassed very easily but let's prefer usage of public API)
This commit is contained in:
Mygod
2018-01-04 14:56:07 +08:00
parent 19feec30bc
commit faf5466ced
6 changed files with 52 additions and 51 deletions

View File

@@ -66,14 +66,14 @@ class MainActivity : AppCompatActivity(), ServiceConnection, Toolbar.OnMenuItemC
inner class ClientAdapter : RecyclerView.Adapter<ClientViewHolder>() {
private var owner: WifiP2pDevice? = null
private lateinit var clients: MutableCollection<WifiP2pDevice>
private lateinit var arpCache: ArpCache
private lateinit var arpCache: Map<String, String>
fun fetchClients() {
if (data.running) {
val binder = binder!!
owner = binder.service.group.owner
clients = binder.service.group.clientList
arpCache = ArpCache(binder.service.downstream)
arpCache = NetUtils.arp(binder.service.downstream)
} else owner = null
notifyDataSetChanged() // recreate everything
}