diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt b/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt index 9d731a5..5b01a54 100644 --- a/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt +++ b/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2023 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -18,10 +18,8 @@ | |||
18 | 18 | ||
19 | package org.pacien.tincapp.context | 19 | package org.pacien.tincapp.context |
20 | 20 | ||
21 | import android.app.Notification | ||
22 | import android.app.NotificationChannel | 21 | import android.app.NotificationChannel |
23 | import android.app.NotificationManager | 22 | import android.app.NotificationManager |
24 | import android.app.PendingIntent | ||
25 | import android.content.Context | 23 | import android.content.Context |
26 | import android.content.Intent | 24 | import android.content.Intent |
27 | import android.net.Uri | 25 | import android.net.Uri |
@@ -30,6 +28,7 @@ import androidx.annotation.RequiresApi | |||
30 | import androidx.core.app.NotificationCompat | 28 | import androidx.core.app.NotificationCompat |
31 | import androidx.core.app.NotificationManagerCompat | 29 | import androidx.core.app.NotificationManagerCompat |
32 | import org.pacien.tincapp.R | 30 | import org.pacien.tincapp.R |
31 | import org.pacien.tincapp.utils.PendingIntentUtils | ||
33 | 32 | ||
34 | /** | 33 | /** |
35 | * @author pacien | 34 | * @author pacien |
@@ -95,7 +94,7 @@ class AppNotificationManager(private val context: Context) { | |||
95 | 94 | ||
96 | private fun NotificationCompat.Builder.setManualLink(manualLink: String) = apply { | 95 | private fun NotificationCompat.Builder.setManualLink(manualLink: String) = apply { |
97 | val intent = Intent(Intent.ACTION_VIEW, Uri.parse(manualLink)) | 96 | val intent = Intent(Intent.ACTION_VIEW, Uri.parse(manualLink)) |
98 | val pendingIntent = PendingIntent.getActivity(context, 0, intent, 0) | 97 | val pendingIntent = PendingIntentUtils.getActivity(context, 0, intent, 0) |
99 | addAction(R.drawable.ic_help_primary_24dp, context.getString(R.string.notification_error_action_open_manual), pendingIntent) | 98 | addAction(R.drawable.ic_help_primary_24dp, context.getString(R.string.notification_error_action_open_manual), pendingIntent) |
100 | } | 99 | } |
101 | } | 100 | } |