Fix notification wake screen on

This commit is contained in:
Horis
2025-01-10 17:29:13 +08:00
parent 38390e8ce6
commit c882265de2
6 changed files with 6 additions and 0 deletions
@@ -568,6 +568,7 @@ class AudioPlayService : BaseService(),
.setSmallIcon(R.drawable.ic_volume_up) .setSmallIcon(R.drawable.ic_volume_up)
.setSubText(getString(R.string.audio)) .setSubText(getString(R.string.audio))
.setOngoing(true) .setOngoing(true)
.setOnlyAlertOnce(true)
.setContentTitle(nTitle) .setContentTitle(nTitle)
.setContentText(nSubtitle) .setContentText(nSubtitle)
.setContentIntent( .setContentIntent(
@@ -551,6 +551,7 @@ abstract class BaseReadAloudService : BaseService(),
.setSmallIcon(R.drawable.ic_volume_up) .setSmallIcon(R.drawable.ic_volume_up)
.setSubText(getString(R.string.read_aloud)) .setSubText(getString(R.string.read_aloud))
.setOngoing(true) .setOngoing(true)
.setOnlyAlertOnce(true)
.setContentTitle(nTitle) .setContentTitle(nTitle)
.setContentText(nSubtitle) .setContentText(nSubtitle)
.setContentIntent( .setContentIntent(
@@ -51,6 +51,7 @@ class CacheBookService : BaseService() {
val builder = NotificationCompat.Builder(this, AppConst.channelIdDownload) val builder = NotificationCompat.Builder(this, AppConst.channelIdDownload)
.setSmallIcon(R.drawable.ic_download) .setSmallIcon(R.drawable.ic_download)
.setOngoing(true) .setOngoing(true)
.setOnlyAlertOnce(true)
.setContentTitle(getString(R.string.offline_cache)) .setContentTitle(getString(R.string.offline_cache))
.setContentIntent(activityPendingIntent<CacheActivity>("cacheActivity")) .setContentIntent(activityPendingIntent<CacheActivity>("cacheActivity"))
builder.addAction( builder.addAction(
@@ -63,6 +63,7 @@ class CheckSourceService : BaseService() {
NotificationCompat.Builder(this, AppConst.channelIdReadAloud) NotificationCompat.Builder(this, AppConst.channelIdReadAloud)
.setSmallIcon(R.drawable.ic_network_check) .setSmallIcon(R.drawable.ic_network_check)
.setOngoing(true) .setOngoing(true)
.setOnlyAlertOnce(true)
.setContentTitle(getString(R.string.check_book_source)) .setContentTitle(getString(R.string.check_book_source))
.setContentIntent( .setContentIntent(
activityPendingIntent<BookSourceActivity>("activity") activityPendingIntent<BookSourceActivity>("activity")
@@ -249,6 +249,7 @@ class DownloadService : BaseService() {
.setSmallIcon(R.drawable.ic_download) .setSmallIcon(R.drawable.ic_download)
.setSubText(getString(R.string.action_download)) .setSubText(getString(R.string.action_download))
.setContentTitle(content) .setContentTitle(content)
.setOnlyAlertOnce(true)
.setContentIntent( .setContentIntent(
servicePendingIntent<DownloadService>(IntentAction.play, downloadId.toInt()) { servicePendingIntent<DownloadService>(IntentAction.play, downloadId.toInt()) {
putExtra("downloadId", downloadId) putExtra("downloadId", downloadId)
@@ -160,6 +160,7 @@ class ExportBookService : BaseService() {
.setContentText(notificationContentText) .setContentText(notificationContentText)
.setDeleteIntent(servicePendingIntent<ExportBookService>(IntentAction.stop)) .setDeleteIntent(servicePendingIntent<ExportBookService>(IntentAction.stop))
.setGroup(groupKey) .setGroup(groupKey)
.setOnlyAlertOnce(true)
if (!finish) { if (!finish) {
notification.setOngoing(true) notification.setOngoing(true)
notification.addAction( notification.addAction(