Refine code style

This commit is contained in:
Mygod
2018-12-29 01:38:50 +08:00
parent cfe785f510
commit 5fc67d4249
9 changed files with 12 additions and 16 deletions

View File

@@ -58,8 +58,8 @@ object DefaultNetworkMonitor : UpstreamMonitor() {
it.onAvailable(ifname, properties.dnsServers)
}
}
properties.dnsServers != oldProperties.dnsServers -> {
callbacks.forEach { it.onAvailable(ifname, properties.dnsServers) }
properties.dnsServers != oldProperties.dnsServers -> callbacks.forEach {
it.onAvailable(ifname, properties.dnsServers)
}
}
}

View File

@@ -3,6 +3,7 @@ package be.mygod.vpnhotspot.net.monitor
import android.content.SharedPreferences
import android.net.LinkProperties
import be.mygod.vpnhotspot.App.Companion.app
import java.lang.UnsupportedOperationException
import java.net.InetAddress
import java.util.*
import java.util.concurrent.ConcurrentHashMap
@@ -61,7 +62,7 @@ abstract class UpstreamMonitor {
* commit: https://android.googlesource.com/platform/system/netd/+/758627c4d93392190b08e9aaea3bbbfb92a5f364
*/
fun onFallback() {
throw NotImplementedError()
throw UnsupportedOperationException()
}
}

View File

@@ -62,8 +62,8 @@ object VpnMonitor : UpstreamMonitor() {
it.onAvailable(ifname, properties.dnsServers)
}
}
properties.dnsServers != oldProperties.dnsServers -> {
callbacks.forEach { it.onAvailable(ifname, properties.dnsServers) }
properties.dnsServers != oldProperties.dnsServers -> callbacks.forEach {
it.onAvailable(ifname, properties.dnsServers)
}
}
}