feat: move subscriptions to new notification method
This commit is contained in:
parent
a39db5ea93
commit
808d4e6bf5
32 changed files with 491 additions and 620 deletions
|
@ -7,12 +7,10 @@ import ani.dantotsu.util.Logger
|
|||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class CommentNotificationReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
Logger.log("CommentNotificationReceiver: onReceive")
|
||||
if (context != null) {
|
||||
runBlocking {
|
||||
CommentNotificationTask().execute(context)
|
||||
}
|
||||
runBlocking {
|
||||
CommentNotificationTask().execute(context)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ class CommentNotificationWorker(appContext: Context, workerParams: WorkerParamet
|
|||
return if (CommentNotificationTask().execute(applicationContext)) {
|
||||
Result.success()
|
||||
} else {
|
||||
Logger.log("CommentNotificationWorker: doWork failed")
|
||||
Result.retry()
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +28,7 @@ class CommentNotificationWorker(appContext: Context, workerParams: WorkerParamet
|
|||
}
|
||||
|
||||
companion object {
|
||||
val checkIntervals = arrayOf(0L, 720, 1440)
|
||||
val checkIntervals = arrayOf(0L, 480, 720, 1440)
|
||||
const val WORK_NAME = "ani.dantotsu.notifications.comment.CommentNotificationWorker"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue