Просмотр исходного кода

Fix notification wake screen on

Horis 1 год назад
Родитель
Сommit
e34b169d65

+ 1 - 0
app/src/main/java/io/legado/app/service/AudioPlayService.kt

@@ -568,6 +568,7 @@ class AudioPlayService : BaseService(),
             .setSmallIcon(R.drawable.ic_volume_up)
             .setSubText(getString(R.string.audio))
             .setOngoing(true)
+            .setOnlyAlertOnce(true)
             .setContentTitle(nTitle)
             .setContentText(nSubtitle)
             .setContentIntent(

+ 1 - 0
app/src/main/java/io/legado/app/service/BaseReadAloudService.kt

@@ -551,6 +551,7 @@ abstract class BaseReadAloudService : BaseService(),
             .setSmallIcon(R.drawable.ic_volume_up)
             .setSubText(getString(R.string.read_aloud))
             .setOngoing(true)
+            .setOnlyAlertOnce(true)
             .setContentTitle(nTitle)
             .setContentText(nSubtitle)
             .setContentIntent(

+ 1 - 0
app/src/main/java/io/legado/app/service/CacheBookService.kt

@@ -51,6 +51,7 @@ class CacheBookService : BaseService() {
         val builder = NotificationCompat.Builder(this, AppConst.channelIdDownload)
             .setSmallIcon(R.drawable.ic_download)
             .setOngoing(true)
+            .setOnlyAlertOnce(true)
             .setContentTitle(getString(R.string.offline_cache))
             .setContentIntent(activityPendingIntent<CacheActivity>("cacheActivity"))
         builder.addAction(

+ 1 - 0
app/src/main/java/io/legado/app/service/CheckSourceService.kt

@@ -63,6 +63,7 @@ class CheckSourceService : BaseService() {
         NotificationCompat.Builder(this, AppConst.channelIdReadAloud)
             .setSmallIcon(R.drawable.ic_network_check)
             .setOngoing(true)
+            .setOnlyAlertOnce(true)
             .setContentTitle(getString(R.string.check_book_source))
             .setContentIntent(
                 activityPendingIntent<BookSourceActivity>("activity")

+ 1 - 0
app/src/main/java/io/legado/app/service/DownloadService.kt

@@ -249,6 +249,7 @@ class DownloadService : BaseService() {
             .setSmallIcon(R.drawable.ic_download)
             .setSubText(getString(R.string.action_download))
             .setContentTitle(content)
+            .setOnlyAlertOnce(true)
             .setContentIntent(
                 servicePendingIntent<DownloadService>(IntentAction.play, downloadId.toInt()) {
                     putExtra("downloadId", downloadId)

+ 1 - 0
app/src/main/java/io/legado/app/service/ExportBookService.kt

@@ -160,6 +160,7 @@ class ExportBookService : BaseService() {
             .setContentText(notificationContentText)
             .setDeleteIntent(servicePendingIntent<ExportBookService>(IntentAction.stop))
             .setGroup(groupKey)
+            .setOnlyAlertOnce(true)
         if (!finish) {
             notification.setOngoing(true)
             notification.addAction(