summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
diff options
context:
space:
mode:
authorfupduck <fupduck@riseup.net>2018-02-08 06:05:16 -0800
committerfupduck <fupduck@riseup.net>2018-02-08 06:05:16 -0800
commitc3d157c91ecc3a177efc4e089904684511e7710d (patch)
treed664bf391e0fe2abda37cd78947703b186515c14 /app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
parente33292227eeac35194f9217edd5a243c688cb560 (diff)
parent6cd010c331cfd98078e657bb8d1107651daca49e (diff)
Merge branch '#8829_notification_handling_new_layout' into '0.9.8'
#8829 notification handling new layout See merge request leap/bitmask_android!37
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java b/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
index 5b089524..459f337b 100644
--- a/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
@@ -44,6 +44,8 @@ import static android.text.TextUtils.isEmpty;
import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK;
import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_WAITING_FOR_USER_INPUT;
import static se.leap.bitmaskclient.Constants.EIP_ACTION_STOP_BLOCKING_VPN;
+import static se.leap.bitmaskclient.EipFragment.ASK_TO_CANCEL_VPN;
+import static se.leap.bitmaskclient.MainActivity.ACTION_SHOW_VPN_FRAGMENT;
/**
* Created by cyberta on 14.01.18.
@@ -86,7 +88,7 @@ public class VpnNotificationManager {
VoidVpnService.NOTIFICATION_CHANNEL_NEWSTATUS_ID,
PRIORITY_MAX,
0,
- getDashboardIntent(),
+ getMainActivityIntent(),
actionBuilder.build());
}
@@ -122,7 +124,7 @@ public class VpnNotificationManager {
if (status == LEVEL_WAITING_FOR_USER_INPUT)
contentIntent = getUserInputIntent(msg);
else
- contentIntent = getDashboardIntent();
+ contentIntent = getMainActivityIntent();
int priority;
if (OpenVPNService.NOTIFICATION_CHANNEL_NEWSTATUS_ID.equals(notificationChannelNewstatusId)) {
@@ -254,11 +256,9 @@ public class VpnNotificationManager {
lastNotificationChannel = notificationChannelNewstatusId;
}
- private PendingIntent getDashboardIntent() {
- Intent startDashboard = new Intent(context, Dashboard.class);
- startDashboard.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
- Intent.FLAG_ACTIVITY_SINGLE_TOP);
- return PendingIntent.getActivity(context, 0, startDashboard, PendingIntent.FLAG_CANCEL_CURRENT);
+ private PendingIntent getMainActivityIntent() {
+ Intent startActivity = new Intent(context, StartActivity.class);
+ return PendingIntent.getActivity(context, 0, startActivity, PendingIntent.FLAG_CANCEL_CURRENT);
}
private PendingIntent getStopVoidVpnIntent() {
@@ -268,10 +268,10 @@ public class VpnNotificationManager {
}
private PendingIntent getDisconnectIntent() {
- Intent disconnectVPN = new Intent(context, Dashboard.class);
- disconnectVPN.setAction(Intent.ACTION_MAIN); //needs to be set that actual action can get triggered
- disconnectVPN.putExtra(Dashboard.ACTION_ASK_TO_CANCEL_VPN, true);
- disconnectVPN.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+ Intent disconnectVPN = new Intent(context, MainActivity.class);
+ disconnectVPN.setAction(ACTION_SHOW_VPN_FRAGMENT);
+ disconnectVPN.putExtra(ASK_TO_CANCEL_VPN, true);
+ disconnectVPN.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
return PendingIntent.getActivity(context, 0, disconnectVPN, PendingIntent.FLAG_CANCEL_CURRENT);
}