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) {
|
override fun onLinkPropertiesChanged(network: Network, properties: LinkProperties) {
|
||||||
|
if (currentNetwork == null) {
|
||||||
|
onAvailable(network)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (currentNetwork != network) return
|
if (currentNetwork != network) return
|
||||||
val oldProperties = currentLinkProperties!!
|
val oldProperties = currentLinkProperties!!
|
||||||
currentLinkProperties = properties
|
currentLinkProperties = properties
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ object VpnMonitor : UpstreamMonitor() {
|
|||||||
|
|
||||||
override fun onLinkPropertiesChanged(network: Network, properties: LinkProperties) {
|
override fun onLinkPropertiesChanged(network: Network, properties: LinkProperties) {
|
||||||
synchronized(this@VpnMonitor) {
|
synchronized(this@VpnMonitor) {
|
||||||
|
if (currentNetwork == null) {
|
||||||
|
onAvailable(network)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (currentNetwork != network) return
|
if (currentNetwork != network) return
|
||||||
val oldProperties = available.put(network, properties)!!
|
val oldProperties = available.put(network, properties)!!
|
||||||
val ifname = properties.interfaceName
|
val ifname = properties.interfaceName
|
||||||
|
|||||||
Reference in New Issue
Block a user