diff options
author | cyBerta <cyberta@riseup.net> | 2019-07-06 17:37:48 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-07-12 17:03:55 +0200 |
commit | 65a09aa799e525d3bc60f5f4f489a3d70c6a8554 (patch) | |
tree | 21664e9cc83c368395bacdc8abe3292c9a7db89d /app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java | |
parent | f5b8dae753448ed698486af8b49b977a58d4fcdc (diff) |
get rid of ics-openvpn's ProfileManager, reduces boilerplate and dead code
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; + } } |