pull/48/head
kunfei 5 years ago
parent 0e33557d02
commit 760a38f403
  1. 4
      app/src/main/java/io/legado/app/constant/AppConst.kt
  2. 2
      app/src/main/java/io/legado/app/service/AudioPlayService.kt
  3. 2
      app/src/main/java/io/legado/app/service/BaseReadAloudService.kt
  4. 3
      app/src/main/java/io/legado/app/service/WebService.kt

@ -55,4 +55,8 @@ object AppConst {
set(value) { set(value) {
App.INSTANCE.putPrefBoolean("bookGroupAudio", value) App.INSTANCE.putPrefBoolean("bookGroupAudio", value)
} }
const val notificationIdRead = 12
const val notificationIdAudio = 13
const val notificationIdWeb = 14
} }

@ -343,7 +343,7 @@ class AudioPlayService : BaseService(),
) )
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
val notification = builder.build() val notification = builder.build()
startForeground(112201, notification) startForeground(AppConst.notificationIdAudio, notification)
} }
/** /**

@ -320,7 +320,7 @@ abstract class BaseReadAloudService : BaseService(),
) )
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
val notification = builder.build() val notification = builder.build()
startForeground(112201, notification) startForeground(AppConst.notificationIdRead, notification)
} }
abstract fun aloudServicePendingIntent(actionStr: String): PendingIntent? abstract fun aloudServicePendingIntent(actionStr: String): PendingIntent?

@ -63,7 +63,6 @@ class WebService : BaseService() {
) )
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
val notification = builder.build() val notification = builder.build()
val notificationId = 1122 startForeground(AppConst.notificationIdWeb, notification)
startForeground(notificationId, notification)
} }
} }
Loading…
Cancel
Save