summaryrefslogtreecommitdiff
path: root/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java b/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java
index 9cb69a3d..94c1f1db 100644
--- a/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java
+++ b/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java
@@ -7,7 +7,6 @@ package de.blinkt.openvpn;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
-import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -23,6 +22,7 @@ import de.blinkt.openvpn.core.ConnectionStatus;
import de.blinkt.openvpn.core.IOpenVPNServiceInternal;
import de.blinkt.openvpn.core.OpenVPNService;
import de.blinkt.openvpn.core.ProfileManager;
+import de.blinkt.openvpn.core.VPNLaunchHelper;
import de.blinkt.openvpn.core.VpnStatus;
@@ -85,14 +85,7 @@ public class OpenVPNTileService extends TileService implements VpnStatus.StateLi
@SuppressLint("Override")
@TargetApi(Build.VERSION_CODES.N)
void launchVPN(VpnProfile profile, Context context) {
- Intent startVpnIntent = new Intent(Intent.ACTION_MAIN);
- startVpnIntent.setClass(context, LaunchVPN.class);
- startVpnIntent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUIDString());
- startVpnIntent.putExtra(LaunchVPN.EXTRA_START_REASON, "QuickTile");
- startVpnIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startVpnIntent.putExtra(LaunchVPN.EXTRA_HIDELOG, true);
-
- context.startActivity(startVpnIntent);
+ VPNLaunchHelper.startOpenVpn(profile, getBaseContext(), "QuickTile");
}
@TargetApi(Build.VERSION_CODES.N)