aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-08 23:59:25 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-08 23:59:25 +0200
commitf9937273fd6ee191fee5fbdee150907df1cfb08e (patch)
tree51770336860a381739173e754123bd4c111e8cd6
parentBuild with different name and ID in debug mode (diff)
downloadwireguard-android-f9937273fd6ee191fee5fbdee150907df1cfb08e.tar.xz
wireguard-android-f9937273fd6ee191fee5fbdee150907df1cfb08e.zip
Use instanceOf instead of getClass
-rw-r--r--app/src/main/java/com/wireguard/android/BootShutdownReceiver.java2
-rw-r--r--app/src/main/java/com/wireguard/android/activity/BaseActivity.java2
-rw-r--r--app/src/main/java/com/wireguard/android/activity/SettingsActivity.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/com/wireguard/android/BootShutdownReceiver.java b/app/src/main/java/com/wireguard/android/BootShutdownReceiver.java
index 1a8c96a..3b9f852 100644
--- a/app/src/main/java/com/wireguard/android/BootShutdownReceiver.java
+++ b/app/src/main/java/com/wireguard/android/BootShutdownReceiver.java
@@ -21,7 +21,7 @@ public class BootShutdownReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent intent) {
Application.onHaveBackend(backend -> {
- if (backend.getClass() != WgQuickBackend.class)
+ if (!(backend instanceof WgQuickBackend))
return;
final String action = intent.getAction();
if (action == null)
diff --git a/app/src/main/java/com/wireguard/android/activity/BaseActivity.java b/app/src/main/java/com/wireguard/android/activity/BaseActivity.java
index b7aee1e..e5aaadf 100644
--- a/app/src/main/java/com/wireguard/android/activity/BaseActivity.java
+++ b/app/src/main/java/com/wireguard/android/activity/BaseActivity.java
@@ -54,7 +54,7 @@ public abstract class BaseActivity extends ThemeChangeAwareActivity {
super.onCreate(savedInstanceState);
Application.onHaveBackend(backend -> {
- if (backend.getClass() == GoBackend.class) {
+ if (backend instanceof GoBackend) {
final Intent intent = GoBackend.VpnService.prepare(this);
if (intent != null)
startActivityForResult(intent, 0);
diff --git a/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java b/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
index a8d58e6..ed2da4d 100644
--- a/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
+++ b/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
@@ -102,7 +102,7 @@ public class SettingsActivity extends ThemeChangeAwareActivity {
final PreferenceScreen screen = getPreferenceScreen();
Application.onHaveBackend(backend -> {
for (final Preference pref : wgQuickOnlyPrefs) {
- if (backend.getClass() == WgQuickBackend.class)
+ if (backend instanceof WgQuickBackend)
pref.setVisible(true);
else
screen.removePreference(pref);