Update job intent service scheduling

pull/757/head
Alex Baker 6 years ago
parent 09165ad306
commit dddfa528d2

@ -8,13 +8,13 @@ import timber.log.Timber;
public abstract class InjectingJobIntentService extends JobIntentService { public abstract class InjectingJobIntentService extends JobIntentService {
public static final int JOB_ID_BACKGROUND_SCHEDULER = 2; public static final int JOB_ID_BACKGROUND_SCHEDULER = 1080;
public static final int JOB_ID_GEOFENCE_TRANSITION = 4; public static final int JOB_ID_GEOFENCE_TRANSITION = 1081;
public static final int JOB_ID_GEOFENCE_SCHEDULING = 5; public static final int JOB_ID_GEOFENCE_SCHEDULING = 1082;
public static final int JOB_ID_TASK_STATUS_CHANGE = 8; public static final int JOB_ID_TASK_STATUS_CHANGE = 1083;
public static final int JOB_ID_NOTIFICATION_SCHEDULER = 9; public static final int JOB_ID_NOTIFICATION_SCHEDULER = 1084;
public static final int JOB_ID_CALENDAR_NOTIFICATION = 10; public static final int JOB_ID_CALENDAR_NOTIFICATION = 1085;
public static final int JOB_ID_TASKER = 11; public static final int JOB_ID_TASKER = 1086;
@Override @Override
protected final void onHandleWork(@NonNull Intent intent) { protected final void onHandleWork(@NonNull Intent intent) {

@ -8,8 +8,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.provider.CalendarContract; import android.provider.CalendarContract;
import androidx.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.reminders.ReminderService; import com.todoroo.astrid.reminders.ReminderService;
import com.todoroo.astrid.repeats.RepeatTaskHelper; import com.todoroo.astrid.repeats.RepeatTaskHelper;
@ -41,11 +41,14 @@ public class AfterSaveIntentService extends InjectingJobIntentService {
@Inject PushReceiver pushReceiver; @Inject PushReceiver pushReceiver;
public static void enqueue(Context context, Task current, Task original) { public static void enqueue(Context context, Task current, Task original) {
Intent intent = new Intent(); Intent intent = new Intent(context, AfterSaveIntentService.class);
intent.putExtra(EXTRA_CURRENT, current); intent.putExtra(EXTRA_CURRENT, current);
intent.putExtra(EXTRA_ORIGINAL, original); intent.putExtra(EXTRA_ORIGINAL, original);
AfterSaveIntentService.enqueueWork( AfterSaveIntentService.enqueueWork(
context, AfterSaveIntentService.class, InjectingJobIntentService.JOB_ID_TASK_STATUS_CHANGE, intent); context,
AfterSaveIntentService.class,
InjectingJobIntentService.JOB_ID_TASK_STATUS_CHANGE,
intent);
} }
@Override @Override

@ -21,7 +21,10 @@ public class BackgroundScheduler extends InjectingJobIntentService {
public static void enqueueWork(Context context) { public static void enqueueWork(Context context) {
BackgroundScheduler.enqueueWork( BackgroundScheduler.enqueueWork(
context, BackgroundScheduler.class, InjectingJobIntentService.JOB_ID_BACKGROUND_SCHEDULER, new Intent()); context,
BackgroundScheduler.class,
InjectingJobIntentService.JOB_ID_BACKGROUND_SCHEDULER,
new Intent(context, BackgroundScheduler.class));
} }
@Override @Override

@ -34,7 +34,7 @@ public class CalendarNotificationIntentService extends RecurringIntervalIntentSe
context, context,
CalendarNotificationIntentService.class, CalendarNotificationIntentService.class,
InjectingJobIntentService.JOB_ID_CALENDAR_NOTIFICATION, InjectingJobIntentService.JOB_ID_CALENDAR_NOTIFICATION,
new Intent()); new Intent(context, CalendarNotificationIntentService.class));
} }
@Override @Override

@ -18,7 +18,7 @@ public class GeofenceSchedulingIntentService extends InjectingJobIntentService {
context, context,
GeofenceSchedulingIntentService.class, GeofenceSchedulingIntentService.class,
InjectingJobIntentService.JOB_ID_GEOFENCE_SCHEDULING, InjectingJobIntentService.JOB_ID_GEOFENCE_SCHEDULING,
new Intent()); new Intent(context, GeofenceSchedulingIntentService.class));
} }
@Override @Override

@ -22,7 +22,7 @@ public class NotificationSchedulerIntentService extends InjectingJobIntentServic
@Inject NotificationManager notificationManager; @Inject NotificationManager notificationManager;
public static void enqueueWork(Context context, boolean cancelNotifications) { public static void enqueueWork(Context context, boolean cancelNotifications) {
Intent intent = new Intent(); Intent intent = new Intent(context, NotificationSchedulerIntentService.class);
intent.putExtra(EXTRA_CANCEL_EXISTING_NOTIFICATIONS, cancelNotifications); intent.putExtra(EXTRA_CANCEL_EXISTING_NOTIFICATIONS, cancelNotifications);
JobIntentService.enqueueWork( JobIntentService.enqueueWork(
context, context,

Loading…
Cancel
Save