diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-08-13 23:09:21 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-08-13 23:09:21 +0200 |
commit | 4efa4da4839e61e20eb42e6d0c9b77af61347665 (patch) | |
tree | 67a1475da8787c94aaa8e067ded921643be610b6 /src/de/blinkt/openvpn/ProfileManager.java | |
parent | 4dbad7ca28990e93f24e202c2e67c83d91a89215 (diff) |
Allow editing the VPN Config from the log screen to ease configuration iterations
Diffstat (limited to 'src/de/blinkt/openvpn/ProfileManager.java')
-rw-r--r-- | src/de/blinkt/openvpn/ProfileManager.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/ProfileManager.java b/src/de/blinkt/openvpn/ProfileManager.java index 5d498c67..a40e6fcb 100644 --- a/src/de/blinkt/openvpn/ProfileManager.java +++ b/src/de/blinkt/openvpn/ProfileManager.java @@ -26,6 +26,10 @@ public class ProfileManager { private static ProfileManager instance; + + + + private static VpnProfile mLastConnectedVpn=null; private HashMap<String,VpnProfile> profiles=new HashMap<String, VpnProfile>(); @@ -52,7 +56,7 @@ public class ProfileManager { return instance; } - public static void onBootDelete(Context c) { + public static void setConntectedVpnProfileDisconnected(Context c) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); Editor prefsedit = prefs.edit(); prefsedit.putString(ONBOOTPROFILE, null); @@ -60,12 +64,13 @@ public class ProfileManager { } - public static void setOnBootProfile(Context c, VpnProfile bootprofile) { + public static void setConnectedVpnProfile(Context c, VpnProfile connectedrofile) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); Editor prefsedit = prefs.edit(); - prefsedit.putString(ONBOOTPROFILE, bootprofile.getUUIDString()); + prefsedit.putString(ONBOOTPROFILE, connectedrofile.getUUIDString()); prefsedit.apply(); + mLastConnectedVpn=connectedrofile; } @@ -183,6 +188,8 @@ public class ProfileManager { profiles.remove(vpnentry); saveProfileList(context); context.deleteFile(vpnentry + ".vp"); + if(mLastConnectedVpn==profile) + mLastConnectedVpn=null; } @@ -193,4 +200,10 @@ public class ProfileManager { return get(profileUUID); } + + + public static VpnProfile getLastConnectedVpn() { + return mLastConnectedVpn; + } + } |