You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tasks/app/src/main/java/org/tasks/scheduling/BackgroundScheduler.java

31 lines
1.1 KiB
Java

package org.tasks.scheduling;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.JobIntentService;
import org.tasks.injection.ForApplication;
import org.tasks.jobs.JobManager;
import javax.inject.Inject;
public class BackgroundScheduler {
private final Context context;
@Inject
public BackgroundScheduler(@ForApplication Context context) {
this.context = context;
}
public void scheduleEverything() {
JobIntentService.enqueueWork(context, GeofenceSchedulingIntentService.class, JobManager.JOB_ID_GEOFENCE_SCHEDULING, new Intent());
JobIntentService.enqueueWork(context, SchedulerIntentService.class, JobManager.JOB_ID_SCHEDULER, new Intent());
JobIntentService.enqueueWork(context, NotificationSchedulerIntentService.class, JobManager.JOB_ID_NOTIFICATION_SCHEDULER, new Intent());
scheduleCalendarNotifications();
}
public void scheduleCalendarNotifications() {
JobIntentService.enqueueWork(context, CalendarNotificationIntentService.class, JobManager.JOB_ID_CALENDAR_NOTIFICATION, new Intent());
}
}