fix(notification): minimize FGS notification visibility (bump channel to v2)

This commit is contained in:
Jens Reinemann 2026-05-18 21:59:58 +02:00
parent 5c187db1f9
commit ae3cf3e660
2 changed files with 7 additions and 1 deletions

View file

@ -68,6 +68,8 @@ internal class MessagingService : Service() {
.setOngoing(true)
.setSilent(true)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setShowWhen(false)
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setContentIntent(openAppIntent)
.build()
}

View file

@ -83,9 +83,11 @@ internal class NotificationHelper @Inject constructor(
description = "Hintergrunddienst für Nachrichten"
setSound(null, null)
enableVibration(false)
setShowBadge(false)
}
val manager = context.getSystemService(NotificationManager::class.java)
manager.deleteNotificationChannel("bollwerk_service") // Veralteter Channel wird durch v2 ersetzt
manager.createNotificationChannel(channel)
manager.createNotificationChannel(serviceChannel)
}
@ -232,6 +234,8 @@ internal class NotificationHelper @Inject constructor(
.setOngoing(true)
.setSilent(true)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setShowWhen(false)
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setContentIntent(openAppIntent)
.build()
}
@ -266,7 +270,7 @@ internal class NotificationHelper @Inject constructor(
companion object {
const val CHANNEL_ID = "bollwerk_messages"
private const val CHANNEL_NAME = "Chat-Nachrichten"
const val SERVICE_CHANNEL_ID = "bollwerk_service"
const val SERVICE_CHANNEL_ID = "bollwerk_service_v2"
private const val SERVICE_CHANNEL_NAME = "Nachrichtendienst"
private const val MESSAGES_REQUEST_CODE = 1001