global: lint codebase with recent changes

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2020-09-16 10:37:21 +02:00
parent 4b36df504c
commit 8b9a40b3d7
8 changed files with 12 additions and 7 deletions
@@ -41,6 +41,7 @@ class TunnelToggleActivity : AppCompatActivity() {
finishAffinity()
}
}
companion object {
private const val TAG = "WireGuard/TunnelToggleActivity"
}
@@ -73,7 +73,7 @@ class ObservableTunnel internal constructor(
var config = config
get() {
if (field == null)
// Opportunistically fetch this if we don't have a cached one, and rely on data bindings to update it eventually
// Opportunistically fetch this if we don't have a cached one, and rely on data bindings to update it eventually
GlobalScope.launch(Dispatchers.Main.immediate) {
try {
manager.getTunnelConfig(this@ObservableTunnel)
@@ -109,7 +109,7 @@ class ObservableTunnel internal constructor(
var statistics: Statistics? = null
get() {
if (field == null || field?.isStale != false)
// Opportunistically fetch this if we don't have a cached one, and rely on data bindings to update it eventually
// Opportunistically fetch this if we don't have a cached one, and rely on data bindings to update it eventually
GlobalScope.launch(Dispatchers.Main.immediate) {
try {
manager.getTunnelStatistics(this@ObservableTunnel)
@@ -26,6 +26,7 @@ import kotlin.system.exitProcess
class KernelModuleDisablerPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
private var state = State.UNKNOWN
init {
isVisible = false
lifecycleScope.launch {
@@ -48,7 +49,7 @@ class KernelModuleDisablerPreference(context: Context, attrs: AttributeSet?) : P
}
lifecycleScope.launch {
val observableTunnels = Application.getTunnelManager().getTunnels()
val downings = observableTunnels.map { async(SupervisorJob()) { it.setStateAsync(Tunnel.State.DOWN) } }
val downings = observableTunnels.map { async(SupervisorJob()) { it.setStateAsync(Tunnel.State.DOWN) } }
try {
downings.awaitAll()
withContext(Dispatchers.IO) {
@@ -12,5 +12,6 @@ import com.wireguard.android.Application
object AdminKnobs {
private val restrictions: RestrictionsManager? = Application.get().getSystemService()
val disableConfigExport: Boolean
get() = restrictions?.applicationRestrictions?.getBoolean("disable_config_export", false) ?: false
get() = restrictions?.applicationRestrictions?.getBoolean("disable_config_export", false)
?: false
}
@@ -19,6 +19,7 @@ import com.wireguard.android.R
object BiometricAuthenticator {
private const val TAG = "WireGuard/BiometricAuthenticator"
// Not all devices support strong biometric auth so we're allowing both device credentials as
// well as weak biometrics.
private const val allowedAuthenticators = Authenticators.DEVICE_CREDENTIAL or Authenticators.BIOMETRIC_WEAK