global: lint codebase with recent changes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
4b36df504c
commit
8b9a40b3d7
@ -116,7 +116,8 @@
|
|||||||
android:value="false" />
|
android:value="false" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<meta-data android:name="android.content.APP_RESTRICTIONS"
|
<meta-data
|
||||||
|
android:name="android.content.APP_RESTRICTIONS"
|
||||||
android:resource="@xml/app_restrictions" />
|
android:resource="@xml/app_restrictions" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ class TunnelToggleActivity : AppCompatActivity() {
|
|||||||
finishAffinity()
|
finishAffinity()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "WireGuard/TunnelToggleActivity"
|
private const val TAG = "WireGuard/TunnelToggleActivity"
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class ObservableTunnel internal constructor(
|
|||||||
var config = config
|
var config = config
|
||||||
get() {
|
get() {
|
||||||
if (field == null)
|
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) {
|
GlobalScope.launch(Dispatchers.Main.immediate) {
|
||||||
try {
|
try {
|
||||||
manager.getTunnelConfig(this@ObservableTunnel)
|
manager.getTunnelConfig(this@ObservableTunnel)
|
||||||
@ -109,7 +109,7 @@ class ObservableTunnel internal constructor(
|
|||||||
var statistics: Statistics? = null
|
var statistics: Statistics? = null
|
||||||
get() {
|
get() {
|
||||||
if (field == null || field?.isStale != false)
|
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) {
|
GlobalScope.launch(Dispatchers.Main.immediate) {
|
||||||
try {
|
try {
|
||||||
manager.getTunnelStatistics(this@ObservableTunnel)
|
manager.getTunnelStatistics(this@ObservableTunnel)
|
||||||
|
@ -26,6 +26,7 @@ import kotlin.system.exitProcess
|
|||||||
|
|
||||||
class KernelModuleDisablerPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
class KernelModuleDisablerPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||||
private var state = State.UNKNOWN
|
private var state = State.UNKNOWN
|
||||||
|
|
||||||
init {
|
init {
|
||||||
isVisible = false
|
isVisible = false
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@ -48,7 +49,7 @@ class KernelModuleDisablerPreference(context: Context, attrs: AttributeSet?) : P
|
|||||||
}
|
}
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
val observableTunnels = Application.getTunnelManager().getTunnels()
|
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 {
|
try {
|
||||||
downings.awaitAll()
|
downings.awaitAll()
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
|
@ -12,5 +12,6 @@ import com.wireguard.android.Application
|
|||||||
object AdminKnobs {
|
object AdminKnobs {
|
||||||
private val restrictions: RestrictionsManager? = Application.get().getSystemService()
|
private val restrictions: RestrictionsManager? = Application.get().getSystemService()
|
||||||
val disableConfigExport: Boolean
|
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 {
|
object BiometricAuthenticator {
|
||||||
private const val TAG = "WireGuard/BiometricAuthenticator"
|
private const val TAG = "WireGuard/BiometricAuthenticator"
|
||||||
|
|
||||||
// Not all devices support strong biometric auth so we're allowing both device credentials as
|
// Not all devices support strong biometric auth so we're allowing both device credentials as
|
||||||
// well as weak biometrics.
|
// well as weak biometrics.
|
||||||
private const val allowedAuthenticators = Authenticators.DEVICE_CREDENTIAL or Authenticators.BIOMETRIC_WEAK
|
private const val allowedAuthenticators = Authenticators.DEVICE_CREDENTIAL or Authenticators.BIOMETRIC_WEAK
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<scale
|
<scale
|
||||||
android:duration="300"
|
android:duration="300"
|
||||||
android:fromXScale="1.0"
|
android:fromXScale="1.0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<scale
|
<scale
|
||||||
android:duration="300"
|
android:duration="300"
|
||||||
android:fromXScale="0"
|
android:fromXScale="0"
|
||||||
|
Loading…
Reference in New Issue
Block a user