add expedited worker getForegroundInfo()/notification for android platform versions older than 12

This commit is contained in:
gavine99
2025-05-07 11:56:36 +10:00
parent 2810b56cd0
commit e29aae3bf1
6 changed files with 40 additions and 3 deletions
@@ -90,6 +90,18 @@ class NotificationManagerImpl @Inject constructor(
createNotificationChannel()
}
override fun getForegroundNotificationForWorkersOnOlderAndroids() =
NotificationCompat.Builder(context, DEFAULT_CHANNEL_ID)
.setContentTitle(context.getString(R.string.notification_foreground_worker_text))
.setShowWhen(false)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.drawable.ic_notification)
.setColor(colors.theme().theme)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setOngoing(true)
.build()
/**
* Updates the notification for a particular conversation
*/