parent
40dd14ca16
commit
9f1af0140f
|
@ -19,7 +19,7 @@ interface NotificationService {
|
||||||
onlyAlertOnce: Boolean = true,
|
onlyAlertOnce: Boolean = true,
|
||||||
): Notification
|
): Notification
|
||||||
|
|
||||||
fun createNotificationAction(action: NotificationAction): NotificationCompat.Action
|
fun createNotificationAction(notificationAction: NotificationAction): NotificationCompat.Action
|
||||||
|
|
||||||
fun remove(notificationId: Int)
|
fun remove(notificationId: Int)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import com.zaneschepke.wireguardautotunnel.R
|
import com.zaneschepke.wireguardautotunnel.R
|
||||||
import com.zaneschepke.wireguardautotunnel.receiver.NotificationActionReceiver
|
import com.zaneschepke.wireguardautotunnel.receiver.NotificationActionReceiver
|
||||||
|
import com.zaneschepke.wireguardautotunnel.ui.MainActivity
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -46,6 +47,8 @@ constructor(
|
||||||
addAction(it)
|
addAction(it)
|
||||||
}
|
}
|
||||||
setContentTitle(title)
|
setContentTitle(title)
|
||||||
|
setContentIntent(PendingIntent.getActivity(context, 0,
|
||||||
|
Intent(context, MainActivity::class.java), PendingIntent.FLAG_UPDATE_CURRENT))
|
||||||
setContentText(description)
|
setContentText(description)
|
||||||
setOnlyAlertOnce(onlyAlertOnce)
|
setOnlyAlertOnce(onlyAlertOnce)
|
||||||
setOngoing(onGoing)
|
setOngoing(onGoing)
|
||||||
|
@ -84,7 +87,7 @@ constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun NotificationChannels.asBuilder(): NotificationCompat.Builder {
|
private fun NotificationChannels.asBuilder(): NotificationCompat.Builder {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
NotificationChannels.AUTO_TUNNEL -> {
|
NotificationChannels.AUTO_TUNNEL -> {
|
||||||
NotificationCompat.Builder(
|
NotificationCompat.Builder(
|
||||||
|
@ -101,7 +104,7 @@ constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun NotificationChannels.asChannel(): NotificationChannel {
|
private fun NotificationChannels.asChannel(): NotificationChannel {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
NotificationChannels.VPN -> {
|
NotificationChannels.VPN -> {
|
||||||
NotificationChannel(
|
NotificationChannel(
|
||||||
|
|
Loading…
Reference in New Issue