Don't use past time when scheduling reminders

A new task with a reminder time in the past but outside of quiet hours
was causing a tight loop when the current time was within quiet hours
pull/820/head
Alex Baker 6 years ago
parent ef62f3851e
commit d281b649a0

@ -170,6 +170,8 @@ public class WorkManager {
@SuppressWarnings("WeakerAccess") @SuppressWarnings("WeakerAccess")
public void scheduleNotification(long time) { public void scheduleNotification(long time) {
time = Math.max(now(), time);
if (time < currentTimeMillis()) { if (time < currentTimeMillis()) {
Intent intent = getNotificationIntent(); Intent intent = getNotificationIntent();
if (atLeastOreo()) { if (atLeastOreo()) {

Loading…
Cancel
Save