summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-10-02 17:51:01 +0200
committercyBerta <cyberta@riseup.net>2017-10-02 17:51:01 +0200
commit455ec6337157118b6d2e49808f25fd80d164956e (patch)
treefd3fbb3aa4d1f26c66d034d9439af42e2f3d924c
parent05b9a9ce15dc139a7ff97b3052dec8fd2e3207eb (diff)
#8759 one cancellation dialog should be sufficient
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index 22a0c6d5..ed7ba2c8 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/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);