Refine code style
This commit is contained in:
@@ -95,13 +95,13 @@ exceptions:
|
||||
PrintStackTrace:
|
||||
active: false
|
||||
RethrowCaughtException:
|
||||
active: true
|
||||
active: false
|
||||
ReturnFromFinally:
|
||||
active: true
|
||||
SwallowedException:
|
||||
active: true
|
||||
ThrowingExceptionFromFinally:
|
||||
active: true
|
||||
active: false
|
||||
ThrowingExceptionInMain:
|
||||
active: true
|
||||
ThrowingExceptionsWithoutMessageOrCause:
|
||||
@@ -317,8 +317,7 @@ style:
|
||||
CollapsibleIfStatements:
|
||||
active: true
|
||||
DataClassContainsFunctions:
|
||||
active: true
|
||||
conversionFunctionPrefix: 'to'
|
||||
active: false
|
||||
EqualsNullCall:
|
||||
active: true
|
||||
ExpressionBodySyntax:
|
||||
|
||||
@@ -17,7 +17,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
resConfigs "zh-rCN"
|
||||
versionCode 109
|
||||
versionCode 110
|
||||
versionName "2.1.1"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.res.Configuration
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import be.mygod.vpnhotspot.App.Companion.app
|
||||
import be.mygod.vpnhotspot.net.TetheringManager
|
||||
|
||||
@@ -118,9 +118,8 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere
|
||||
}
|
||||
private val deviceListener = broadcastReceiver { _, intent ->
|
||||
when (intent.action) {
|
||||
WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION -> {
|
||||
binder.thisDevice = intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE)
|
||||
}
|
||||
WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION -> binder.thisDevice =
|
||||
intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE)
|
||||
WifiP2pManagerHelper.WIFI_P2P_PERSISTENT_GROUPS_CHANGED_ACTION -> onPersistentGroupsChanged()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import androidx.databinding.BaseObservable
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import be.mygod.vpnhotspot.App.Companion.app
|
||||
import be.mygod.vpnhotspot.databinding.ListitemManageBinding
|
||||
import be.mygod.vpnhotspot.widget.SmartSnackbar
|
||||
import timber.log.Timber
|
||||
|
||||
object ManageBar : Manager() {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.widget.Toast
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.OnLifecycleEvent
|
||||
import be.mygod.vpnhotspot.App.Companion.app
|
||||
import be.mygod.vpnhotspot.R
|
||||
|
||||
Reference in New Issue
Block a user