From 354e1c0ed93f0c90aa83b1789daa9d861c8b7cca Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 30 Mar 2023 15:04:25 +0200 Subject: ui: remove unneeded @JvmStatic annotations These are only needed on methods called from databindings, since those compile to java. Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/Application.kt | 7 ------- .../java/com/wireguard/android/fragment/AppListDialogFragment.kt | 1 + .../com/wireguard/android/fragment/ConfigNamingDialogFragment.kt | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'ui/src/main/java/com/wireguard/android') diff --git a/ui/src/main/java/com/wireguard/android/Application.kt b/ui/src/main/java/com/wireguard/android/Application.kt index 44199d9d..928ee346 100644 --- a/ui/src/main/java/com/wireguard/android/Application.kt +++ b/ui/src/main/java/com/wireguard/android/Application.kt @@ -125,27 +125,20 @@ class Application : android.app.Application() { private const val TAG = "WireGuard/Application" private lateinit var weakSelf: WeakReference - @JvmStatic fun get(): Application { return weakSelf.get()!! } - @JvmStatic suspend fun getBackend() = get().futureBackend.await() - @JvmStatic fun getRootShell() = get().rootShell - @JvmStatic fun getPreferencesDataStore() = get().preferencesDataStore - @JvmStatic fun getToolsInstaller() = get().toolsInstaller - @JvmStatic fun getTunnelManager() = get().tunnelManager - @JvmStatic fun getCoroutineScope() = get().coroutineScope } diff --git a/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.kt index 627a9728..42cea1bc 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.kt @@ -154,6 +154,7 @@ class AppListDialogFragment : DialogFragment() { const val KEY_SELECTED_APPS = "selected_apps" const val KEY_IS_EXCLUDED = "is_excluded" const val REQUEST_SELECTION = "request_selection" + fun newInstance(selectedApps: ArrayList?, isExcluded: Boolean): AppListDialogFragment { val extras = Bundle() extras.putStringArrayList(KEY_SELECTED_APPS, selectedApps) diff --git a/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.kt index 97f2ec73..5fa7297b 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.kt @@ -70,7 +70,6 @@ class ConfigNamingDialogFragment : DialogFragment() { companion object { private const val KEY_CONFIG_TEXT = "config_text" - @JvmStatic fun newInstance(configText: String?): ConfigNamingDialogFragment { val extras = Bundle() extras.putString(KEY_CONFIG_TEXT, configText) -- cgit v1.2.3