From 05511d49007a54e47251130300b662bf411542b6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 23 Sep 2020 17:21:27 +0200 Subject: ui: cleanup code after churn Signed-off-by: Jason A. Donenfeld --- .../wireguard/android/fragment/TunnelListFragment.kt | 17 ++--------------- .../main/java/com/wireguard/android/util/Extensions.kt | 1 - 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'ui/src/main/java/com/wireguard/android') diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt index 66b0e8ba..a2eacd0b 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt @@ -6,9 +6,7 @@ package com.wireguard.android.fragment import android.content.Intent import android.content.res.Resources -import android.net.Uri import android.os.Bundle -import android.provider.OpenableColumns import android.util.Log import android.view.LayoutInflater import android.view.Menu @@ -29,28 +27,16 @@ import com.wireguard.android.activity.TunnelCreatorActivity import com.wireguard.android.databinding.ObservableKeyedRecyclerViewAdapter.RowConfigurationHandler import com.wireguard.android.databinding.TunnelListFragmentBinding import com.wireguard.android.databinding.TunnelListItemBinding -import com.wireguard.android.fragment.ConfigNamingDialogFragment.Companion.newInstance import com.wireguard.android.model.ObservableTunnel import com.wireguard.android.util.ErrorMessages import com.wireguard.android.util.TunnelImporter import com.wireguard.android.widget.MultiselectableRelativeLayout -import com.wireguard.config.Config -import kotlinx.coroutines.Deferred -import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import java.io.BufferedReader -import java.io.ByteArrayInputStream -import java.io.InputStreamReader -import java.nio.charset.StandardCharsets import java.util.ArrayList import java.util.HashSet -import java.util.Locale -import java.util.zip.ZipEntry -import java.util.zip.ZipInputStream /** * Fragment containing a list of known WireGuard tunnels. It allows creating and deleting tunnels. @@ -67,7 +53,8 @@ class TunnelListFragment : BaseFragment() { } private val qrImportResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> - val qrCode = IntentIntegrator.parseActivityResult(result.resultCode, result.data)?.contents ?: return@registerForActivityResult + val qrCode = IntentIntegrator.parseActivityResult(result.resultCode, result.data)?.contents + ?: return@registerForActivityResult lifecycleScope.launch { TunnelImporter.importTunnel(parentFragmentManager, qrCode) { showSnackbar(it) } } } diff --git a/ui/src/main/java/com/wireguard/android/util/Extensions.kt b/ui/src/main/java/com/wireguard/android/util/Extensions.kt index 62bda7e9..2d0899c2 100644 --- a/ui/src/main/java/com/wireguard/android/util/Extensions.kt +++ b/ui/src/main/java/com/wireguard/android/util/Extensions.kt @@ -11,7 +11,6 @@ import androidx.annotation.AttrRes import androidx.lifecycle.lifecycleScope import androidx.preference.Preference import com.wireguard.android.Application -import com.wireguard.android.R import com.wireguard.android.activity.SettingsActivity import kotlinx.coroutines.CoroutineScope -- cgit v1.2.3