Preliminary support for stacked links

This commit is contained in:
Mygod
2020-09-11 11:05:38 +08:00
parent 8e0eb1c0bc
commit 2225e6c80e
5 changed files with 18 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package be.mygod.vpnhotspot.net.monitor
import android.net.LinkProperties
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.allInterfaceNames
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@@ -29,7 +30,7 @@ class InterfaceMonitor(val iface: String) : UpstreamMonitor() {
private set
override val currentLinkProperties get() = Services.connectivity.allNetworks
.map { Services.connectivity.getLinkProperties(it) }
.singleOrNull { it?.interfaceName == iface }
.singleOrNull { it?.allInterfaceNames?.contains(iface) == true }
override fun registerCallbackLocked(callback: Callback) {
if (!registered) {