diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 12:01:52 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 12:19:15 -0600 |
commit | 8e8643122eb5783d4412c8a81fb03cc789c3f77c (patch) | |
tree | 43cc7ea98c33115a7b3bc062104deeb75c580f19 /ui/src/main/java/com/wireguard/android/fragment | |
parent | c00a0b12e4bf353a20a520c59961b21374050089 (diff) |
global: get rid of nonnull gradle hack
Hacking things up via gradle is not right, and package-info.java poses
problems with two modules, so instead we just apply it manually to every
class.
Remember to add this to new classes!
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/fragment')
6 files changed, 18 insertions, 0 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java b/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java index 43178665..e806615c 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; @@ -34,6 +36,7 @@ import java9.util.Comparators; import java9.util.stream.Collectors; import java9.util.stream.StreamSupport; +@NonNullForAll public class AppListDialogFragment extends DialogFragment { private static final String KEY_EXCLUDED_APPS = "excludedApps"; diff --git a/ui/src/main/java/com/wireguard/android/fragment/BaseFragment.java b/ui/src/main/java/com/wireguard/android/fragment/BaseFragment.java index 23bf44e7..6fc6d25b 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/BaseFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/BaseFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.content.Context; import android.content.Intent; import androidx.databinding.DataBindingUtil; @@ -32,6 +34,7 @@ import com.wireguard.android.util.ErrorMessages; * attached to a {@code BaseActivity}. */ +@NonNullForAll public abstract class BaseFragment extends Fragment implements OnSelectedTunnelChangedListener { private static final int REQUEST_CODE_VPN_PERMISSION = 23491; private static final String TAG = "WireGuard/" + BaseFragment.class.getSimpleName(); diff --git a/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java b/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java index effa0593..113af0ab 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.app.Activity; import android.app.Dialog; import android.content.Context; @@ -26,6 +28,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Objects; +@NonNullForAll public class ConfigNamingDialogFragment extends DialogFragment { private static final String KEY_CONFIG_TEXT = "config_text"; diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java b/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java index 8d90fa7e..a7ebb5d1 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.os.Bundle; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; @@ -30,6 +32,7 @@ import java.util.TimerTask; * Fragment that shows details about a specific tunnel. */ +@NonNullForAll public class TunnelDetailFragment extends BaseFragment { @Nullable private TunnelDetailFragmentBinding binding; @Nullable private Timer timer; diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java index 92aeb52a..397882d1 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.app.Activity; import android.content.Context; import androidx.databinding.ObservableList; @@ -41,6 +43,7 @@ import java.util.Objects; * Fragment for editing a WireGuard configuration. */ +@NonNullForAll public class TunnelEditorFragment extends BaseFragment implements AppExclusionListener { private static final String KEY_LOCAL_CONFIG = "local_config"; private static final String KEY_ORIGINAL_NAME = "original_name"; diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index 21618e60..747f69fa 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -5,6 +5,8 @@ package com.wireguard.android.fragment; +import com.wireguard.util.NonNullForAll; + import android.annotation.SuppressLint; import android.app.Activity; import android.content.ContentResolver; @@ -64,6 +66,7 @@ import java9.util.stream.StreamSupport; * Fragment containing a list of known WireGuard tunnels. It allows creating and deleting tunnels. */ +@NonNullForAll public class TunnelListFragment extends BaseFragment { public static final int REQUEST_IMPORT = 1; private static final int REQUEST_TARGET_FRAGMENT = 2; |