summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2021-11-24 13:56:40 +0100
committerAlbin <albin@mullvad.net>2021-11-26 14:14:42 +0100
commita3fb314bc01b344750b4d463d033f22e5610c87a (patch)
tree6d28b0142c28a50266c8a9cbc0f0d44bbb79309e /android
parentd0c4eb06245536b75a162588df2e1fe8d1a5fb44 (diff)
downloadmullvadvpn-a3fb314bc01b344750b4d463d033f22e5610c87a.tar.xz
mullvadvpn-a3fb314bc01b344750b4d463d033f22e5610c87a.zip
Remove notification delete intent
This change removes the delete intent from the connection state notification, which means that the service will no longer be killed by swiping the notification (when it's not in foreground).
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt11
1 files changed, 1 insertions, 10 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt
index d59f4dec28..10f929ab97 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt
@@ -9,7 +9,6 @@ import androidx.core.app.NotificationCompat
import kotlin.properties.Delegates.observable
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.model.TunnelState
-import net.mullvad.mullvadvpn.service.MullvadVpnService
import net.mullvad.mullvadvpn.ui.MainActivity
import net.mullvad.talpid.tunnel.ActionAfterDisconnect
@@ -90,15 +89,13 @@ class TunnelStateNotification(val context: Context) {
val pendingIntent =
PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT)
- val deleteIntent = buildDeleteIntent()
-
val actions = if (showAction) {
listOf(buildAction())
} else {
emptyList()
}
- return channel.buildNotification(pendingIntent, notificationText, actions, deleteIntent)
+ return channel.buildNotification(pendingIntent, notificationText, actions)
}
private fun buildAction(): NotificationCompat.Action {
@@ -112,10 +109,4 @@ class TunnelStateNotification(val context: Context) {
return NotificationCompat.Action(action.icon, label, pendingIntent)
}
-
- private fun buildDeleteIntent(): PendingIntent {
- val intent = Intent(MullvadVpnService.KEY_QUIT_ACTION).setPackage("net.mullvad.mullvadvpn")
- val flags = PendingIntent.FLAG_UPDATE_CURRENT
- return PendingIntent.getForegroundService(context, 1, intent, flags)
- }
}