From 64449816223cb9abb6e75310c03dcc9353a42ee4 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 2 Aug 2023 22:45:26 +0200 Subject: use single instance of shared prefernces across the app, this reduces the laggyness of the UI noticably --- app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java') 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 6adffda1..575f1f59 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -335,7 +335,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac Log.d(TAG, "Starting VPN due to isAlwaysOn system settings or app crash."); startWithForegroundNotification(); - mProfile = VpnStatus.getLastConnectedVpnProfile(this); + mProfile = VpnStatus.getLastConnectedVpnProfile(); VpnStatus.logInfo(R.string.service_restarted); if (mProfile != null) { @@ -357,7 +357,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac /* start the OpenVPN process itself in a background thread */ new Thread(this::startOpenVPN).start(); - VpnStatus.setLastConnectedVpnProfile(getApplicationContext(), mProfile); + VpnStatus.setLastConnectedVpnProfile(mProfile); return START_STICKY; } -- cgit v1.2.3