summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-01-02 01:32:22 +0100
committerParménides GV <parmegv@sdf.org>2015-01-02 01:32:22 +0100
commit407e3767744e39a59845423246a9ad427d933304 (patch)
tree18aeb9c1a2fb8d3dda42a2df04db8b9e3da3de17 /app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
parentd23ec1613855f6582b0e79c1a9fc1538d6099944 (diff)
Update vpn profiles correctly.
Before we add a new profile, we check if there are any duplicated ones with the same server IPs and ports. If they've the same credentials of the new one, we don't add anything; if not, we remove the old ones and add the new.
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.java15
1 files changed, 2 insertions, 13 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 e23f67c7..005d0eec 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
@@ -25,6 +25,7 @@ import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
+import java.io.Serializable;
import java.io.StringReader;
import java.util.Collection;
import java.util.Iterator;
@@ -42,7 +43,7 @@ import se.leap.bitmaskclient.Dashboard;
* @author Sean Leonard <meanderingcode@aetherislands.net>
* @author Parménides GV <parmegv@sdf.org>
*/
-public class Gateway {
+public class Gateway implements Serializable {
private String TAG = Gateway.class.getSimpleName();
@@ -137,16 +138,4 @@ public class Gateway {
public int getTimezone() {
return timezone;
}
-
- @Override
- public boolean equals(Object o) {
- if(o instanceof Gateway) {
- VpnProfile compared_profile = ((Gateway) o).getProfile();
- return compared_profile.mConnections.equals(mVpnProfile.mConnections)
- && compared_profile.mClientCertFilename != mVpnProfile.mClientCertFilename
- && compared_profile.mClientKeyFilename != mVpnProfile.mClientKeyFilename;
- }
- else
- return super.equals(o);
- }
}