|
|
@ -14,7 +14,7 @@ import javax.inject.Inject;
|
|
|
|
|
|
|
|
|
|
|
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
|
|
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
|
|
|
import static org.tasks.date.DateTimeUtils.currentTimeMillis;
|
|
|
|
import static org.tasks.date.DateTimeUtils.currentTimeMillis;
|
|
|
|
import static org.tasks.date.DateTimeUtils.newDateTime;
|
|
|
|
import static org.tasks.date.DateTimeUtils.printTimestamp;
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class RecurringIntervalIntentService extends InjectingIntentService {
|
|
|
|
public abstract class RecurringIntervalIntentService extends InjectingIntentService {
|
|
|
|
|
|
|
|
|
|
|
@ -45,11 +45,11 @@ public abstract class RecurringIntervalIntentService extends InjectingIntentServ
|
|
|
|
|
|
|
|
|
|
|
|
if (nextRun < now + PADDING) {
|
|
|
|
if (nextRun < now + PADDING) {
|
|
|
|
nextRun = now + interval;
|
|
|
|
nextRun = now + interval;
|
|
|
|
log.debug("running now [nextRun={}]", newDateTime(nextRun));
|
|
|
|
log.debug("running now [nextRun={}]", printTimestamp(nextRun));
|
|
|
|
preferences.setLong(getLastRunPreference(), now);
|
|
|
|
preferences.setLong(getLastRunPreference(), now);
|
|
|
|
run();
|
|
|
|
run();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.debug("will run at {} [lastRun={}]", newDateTime(nextRun), newDateTime(lastRun));
|
|
|
|
log.debug("will run at {} [lastRun={}]", printTimestamp(nextRun), printTimestamp(lastRun));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
|
|
|