summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index ea782e00..4e92f67b 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -322,7 +322,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
PreferenceHelper.setAlwaysOn(this, false);
} else {
/* The intent is null when we are set as always-on or the service has been restarted. */
- mProfile = ProfileManager.getLastConnectedProfile(this);
+ mProfile = VpnStatus.getLastConnectedVpnProfile(this);
VpnStatus.logInfo(R.string.service_restarted);
if (mProfile != null) {
@@ -344,9 +344,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
/* start the OpenVPN process itself in a background thread */
new Thread(this::startOpenVPN).start();
-
- ProfileManager.setConnectedVpnProfile(this, mProfile);
- VpnStatus.setConnectedVPNProfile(mProfile.getUUIDString());
+ VpnStatus.setLastConnectedVpnProfile(getApplicationContext(), mProfile);
return START_STICKY;
}