aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt
diff options
context:
space:
mode:
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.kt7
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
19package org.pacien.tincapp.context 19package org.pacien.tincapp.context
20 20
21import android.app.Notification
22import android.app.NotificationChannel 21import android.app.NotificationChannel
23import android.app.NotificationManager 22import android.app.NotificationManager
24import android.app.PendingIntent
25import android.content.Context 23import android.content.Context
26import android.content.Intent 24import android.content.Intent
27import android.net.Uri 25import android.net.Uri
@@ -30,6 +28,7 @@ import androidx.annotation.RequiresApi
30import androidx.core.app.NotificationCompat 28import androidx.core.app.NotificationCompat
31import androidx.core.app.NotificationManagerCompat 29import androidx.core.app.NotificationManagerCompat
32import org.pacien.tincapp.R 30import org.pacien.tincapp.R
31import 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}