From 11a11f25e0981d51dd19ee3e7849de1a9f563ec4 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 2 Oct 2017 17:53:35 +0200 Subject: #8759 one cancellation dialog should be sufficient --- app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/de') 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 5faa1de4..835e69b3 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -322,9 +322,11 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac } - Intent disconnectVPN = new Intent(this, DisconnectVPN.class); - disconnectVPN.setAction(DISCONNECT_VPN); - PendingIntent disconnectPendingIntent = PendingIntent.getActivity(this, 0, disconnectVPN, 0); + Intent disconnectVPN = new Intent(this, Dashboard.class); + disconnectVPN.putExtra(Dashboard.ACTION_ASK_TO_CANCEL_VPN, true); + disconnectVPN.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | + Intent.FLAG_ACTIVITY_SINGLE_TOP); + PendingIntent disconnectPendingIntent = PendingIntent.getActivity(this, 0, disconnectVPN, PendingIntent.FLAG_CANCEL_CURRENT); nbuilder.addAction(R.drawable.ic_menu_close_clear_cancel, getString(R.string.cancel_connection), disconnectPendingIntent); -- cgit v1.2.3