Update to Android Q beta 2 APIs

This commit is contained in:
Mygod
2019-04-04 11:31:27 +08:00
parent 400d4e67a3
commit bb41536eb1
6 changed files with 12 additions and 9 deletions

View File

@@ -20,7 +20,8 @@ import be.mygod.vpnhotspot.util.broadcastReceiver
class ClientViewModel : ViewModel(), ServiceConnection, IpNeighbourMonitor.Callback {
private var tetheredInterfaces = emptySet<String>()
private val receiver = broadcastReceiver { _, intent ->
tetheredInterfaces = intent.tetheredIfaces.toSet() + intent.localOnlyTetheredIfaces
tetheredInterfaces = (intent.tetheredIfaces ?: return@broadcastReceiver).toSet() +
(intent.localOnlyTetheredIfaces ?: return@broadcastReceiver)
populateClients()
}