summaryrefslogtreecommitdiff
path: root/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java b/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java
index 165bd647..2856a069 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/ProfileManager.java
@@ -66,21 +66,25 @@ public class ProfileManager {
}
- public static void setConnectedVpnProfile(Context c, VpnProfile connectedrofile) {
+ /**
+ * Sets the profile that is connected (to connect if the service restarts)
+ */
+ public static void setConnectedVpnProfile(Context c, VpnProfile connectedProfile) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c);
Editor prefsedit = prefs.edit();
- prefsedit.putString(LAST_CONNECTED_PROFILE, connectedrofile.getUUIDString());
+ prefsedit.putString(LAST_CONNECTED_PROFILE, connectedProfile.getUUIDString());
prefsedit.apply();
- mLastConnectedVpn = connectedrofile;
+ mLastConnectedVpn = connectedProfile;
}
+ /**
+ * Returns the profile that was last connected (to connect if the service restarts)
+ */
public static VpnProfile getLastConnectedProfile(Context c) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c);
-
-
String lastConnectedProfile = prefs.getString(LAST_CONNECTED_PROFILE, null);
if (lastConnectedProfile != null)
return get(c, lastConnectedProfile);