diff options
author | cyberta <cyberta@riseup.net> | 2019-07-12 10:38:00 -0700 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2019-07-12 10:38:00 -0700 |
commit | 6c9a29082a8543991b8485c8613e7c586fed636f (patch) | |
tree | 3e6730b27eff129a54f6104c2dd2f487ffea2887 /app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java | |
parent | 144244cab15014d495985f396c618729209a8f8a (diff) | |
parent | 50667074dd6729eb47400273f4275ceba2457575 (diff) |
Merge branch 'improve_blocking_vpn' into 'master'
Improve blocking vpn
See merge request leap/bitmask_android!91
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java index 317a91bd..55ade1ae 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java @@ -132,4 +132,18 @@ public class Gateway { public String toString() { return new Gson().toJson(this, Gateway.class); } + + @Override + public boolean equals(Object obj) { + return obj instanceof Gateway && + (this.mVpnProfile != null && + ((Gateway) obj).mVpnProfile != null && + this.mVpnProfile.mConnections != null && + ((Gateway) obj).mVpnProfile != null && + this.mVpnProfile.mConnections.length > 0 && + ((Gateway) obj).mVpnProfile.mConnections.length > 0 && + this.mVpnProfile.mConnections[0].mServerName != null && + this.mVpnProfile.mConnections[0].mServerName.equals(((Gateway) obj).mVpnProfile.mConnections[0].mServerName)) || + this.mVpnProfile == null && ((Gateway) obj).mVpnProfile == null; + } } |