Handle if ifname became non-null
This commit is contained in:
@@ -38,6 +38,10 @@ object DefaultNetworkMonitor : UpstreamMonitor() {
|
||||
}
|
||||
|
||||
override fun onLinkPropertiesChanged(network: Network, properties: LinkProperties) {
|
||||
if (currentNetwork == null) {
|
||||
onAvailable(network)
|
||||
return
|
||||
}
|
||||
if (currentNetwork != network) return
|
||||
val oldProperties = currentLinkProperties!!
|
||||
currentLinkProperties = properties
|
||||
|
||||
@@ -43,6 +43,10 @@ object VpnMonitor : UpstreamMonitor() {
|
||||
|
||||
override fun onLinkPropertiesChanged(network: Network, properties: LinkProperties) {
|
||||
synchronized(this@VpnMonitor) {
|
||||
if (currentNetwork == null) {
|
||||
onAvailable(network)
|
||||
return
|
||||
}
|
||||
if (currentNetwork != network) return
|
||||
val oldProperties = available.put(network, properties)!!
|
||||
val ifname = properties.interfaceName
|
||||
|
||||
Reference in New Issue
Block a user