diff options
author | Parménides GV <parmegv@sdf.org> | 2013-12-03 22:26:31 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-12-04 16:02:11 +0100 |
commit | 6dfb02da9cd6c28b8a3016cf78454add6408c13d (patch) | |
tree | 9cfa94e051b93e4b7d80a03b4dcf00d0510742bb /src/se/leap/bitmaskclient/EIP.java | |
parent | e26be4756596acf5be292955079ae33f228408d8 (diff) |
Vpn profiles get updated after switching provider.
parsedEipSerial wasn't being reset after switching provider, so updating gateways thought there was no real update.
After switching provider, we also remove all other vpn profiles.
Diffstat (limited to 'src/se/leap/bitmaskclient/EIP.java')
-rw-r--r-- | src/se/leap/bitmaskclient/EIP.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index 22f7558d..13261e29 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -252,10 +252,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(); } |