|
|
|
@ -24,10 +24,9 @@ class AlarmService @Inject constructor(
|
|
|
|
private val alarmDao: AlarmDao,
|
|
|
|
private val alarmDao: AlarmDao,
|
|
|
|
private val jobs: NotificationQueue) {
|
|
|
|
private val jobs: NotificationQueue) {
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: remove runBlocking
|
|
|
|
suspend fun rescheduleAlarms(taskId: Long, oldDueDate: Long, newDueDate: Long) {
|
|
|
|
fun rescheduleAlarms(taskId: Long, oldDueDate: Long, newDueDate: Long) = runBlocking {
|
|
|
|
if (oldDueDate <= 0 || newDueDate <= 0 || newDueDate <= oldDueDate) {
|
|
|
|
if (newDueDate <= 0 || newDueDate <= oldDueDate) {
|
|
|
|
return
|
|
|
|
return@runBlocking
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val alarms: MutableSet<Long> = LinkedHashSet()
|
|
|
|
val alarms: MutableSet<Long> = LinkedHashSet()
|
|
|
|
for (alarm in getAlarms(taskId)) {
|
|
|
|
for (alarm in getAlarms(taskId)) {
|
|
|
|
|