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 | 661cc31f36331dd9565df7c4a0ebd8e6ba510051 (patch) | |
tree | ae40806cdebd340523f523aec655cb3939aa5927 /src/de/blinkt/openvpn/ProfileManager.java | |
parent | 9471bec3505d3b76c2e7a1b8a6c31458d265cba5 (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; + } + } |