summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/EIP.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-12-04 17:24:42 +0100
committerParménides GV <parmegv@sdf.org>2013-12-04 17:24:42 +0100
commit90732260daaba438f49e510ed987284bcb419f4d (patch)
treeee30a40be65e993a9f886b47fd57d41717bf4222 /src/se/leap/bitmaskclient/EIP.java
parentdc417fbfc67d8edaad58effde3a6a73fbeeab1da (diff)
parentd004c5535c75540600d6670e86300872651fc7bf (diff)
Merge branch 'bug/fix-switch-provider' into develop
Diffstat (limited to 'src/se/leap/bitmaskclient/EIP.java')
-rw-r--r--src/se/leap/bitmaskclient/EIP.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java
index 22f7558d..ec2f6972 100644
--- a/src/se/leap/bitmaskclient/EIP.java
+++ b/src/se/leap/bitmaskclient/EIP.java
@@ -214,8 +214,7 @@ public final class EIP extends IntentService {
* Intent to {@link se.leap.openvpn.LaunchVPN}
*/
private void startEIP() {
- if (activeGateway==null)
- activeGateway = selectGateway();
+ activeGateway = selectGateway();
Intent intent = new Intent(this,LaunchVPN.class);
intent.setAction(Intent.ACTION_MAIN);
@@ -252,10 +251,19 @@ public final class EIP extends IntentService {
private void updateEIPService() {
try {
eipDefinition = ConfigHelper.getJsonFromSharedPref(EIP.KEY);
+ parsedEipSerial = ConfigHelper.getIntFromSharedPref(PARSED_SERIAL);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
+ if(parsedEipSerial == 0) {
+ // Delete all vpn profiles
+ ProfileManager vpl = ProfileManager.getInstance(context);
+ Collection<VpnProfile> profiles = vpl.getProfiles();
+ for (VpnProfile profile : profiles){
+ vpl.removeProfile(context, profile);
+ }
+ }
if (eipDefinition.optInt("serial") > parsedEipSerial)
updateGateways();
}