From c00a0b12e4bf353a20a520c59961b21374050089 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Mar 2020 12:11:09 -0600 Subject: Application: simplify static block Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/Application.java | 9 +-------- 1 file 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.java b/ui/src/main/java/com/wireguard/android/Application.java index 655c6b21..e32c3755 100644 --- a/ui/src/main/java/com/wireguard/android/Application.java +++ b/ui/src/main/java/com/wireguard/android/Application.java @@ -37,14 +37,7 @@ import java9.util.concurrent.CompletableFuture; public class Application extends android.app.Application implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = "WireGuard/" + Application.class.getSimpleName(); - public static final String USER_AGENT; - - static { - String preferredAbi = "unknown ABI"; - if (Build.SUPPORTED_ABIS.length > 0) - preferredAbi = Build.SUPPORTED_ABIS[0]; - USER_AGENT = String.format(Locale.ENGLISH, "WireGuard/%s (Android %d; %s; %s; %s %s; %s)", BuildConfig.VERSION_NAME, Build.VERSION.SDK_INT, preferredAbi, Build.BOARD, Build.MANUFACTURER, Build.MODEL, Build.FINGERPRINT); - } + public static final String USER_AGENT = String.format(Locale.ENGLISH, "WireGuard/%s (Android %d; %s; %s; %s %s; %s)", BuildConfig.VERSION_NAME, Build.VERSION.SDK_INT, Build.SUPPORTED_ABIS.length > 0 ? Build.SUPPORTED_ABIS[0] : "unknown ABI", Build.BOARD, Build.MANUFACTURER, Build.MODEL, Build.FINGERPRINT); @SuppressWarnings("NullableProblems") private static WeakReference weakSelf; private final CompletableFuture futureBackend = new CompletableFuture<>(); -- cgit v1.2.3