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 static final int JOB_ID_BACKGROUND_SCHEDULER = 2;
public static final int JOB_ID_GEOFENCE_TRANSITION = 4;
public static final int JOB_ID_GEOFENCE_SCHEDULING = 5;
public static final int JOB_ID_TASK_STATUS_CHANGE = 8;
public static final int JOB_ID_NOTIFICATION_SCHEDULER = 9;
public static final int JOB_ID_CALENDAR_NOTIFICATION = 10;
public static final int JOB_ID_TASKER = 11;
public static final int JOB_ID_BACKGROUND_SCHEDULER = 1080;
public static final int JOB_ID_GEOFENCE_TRANSITION = 1081;
public static final int JOB_ID_GEOFENCE_SCHEDULING = 1082;
public static final int JOB_ID_TASK_STATUS_CHANGE = 1083;
public static final int JOB_ID_NOTIFICATION_SCHEDULER = 1084;
public static final int JOB_ID_CALENDAR_NOTIFICATION = 1085;
public static final int JOB_ID_TASKER = 1086;
@Override
protected final void onHandleWork(@NonNull Intent intent) {

@ -8,8 +8,8 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.CalendarContract;
import androidx.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.reminders.ReminderService;
import com.todoroo.astrid.repeats.RepeatTaskHelper;
@ -41,11 +41,14 @@ public class AfterSaveIntentService extends InjectingJobIntentService {
@Inject PushReceiver pushReceiver;
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_ORIGINAL, original);
AfterSaveIntentService.enqueueWork(
context, AfterSaveIntentService.class, InjectingJobIntentService.JOB_ID_TASK_STATUS_CHANGE, intent);
context,
AfterSaveIntentService.class,
InjectingJobIntentService.JOB_ID_TASK_STATUS_CHANGE,
intent);
}
@Override

@ -21,7 +21,10 @@ public class BackgroundScheduler extends InjectingJobIntentService {
public static void enqueueWork(Context context) {
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

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

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

@ -22,7 +22,7 @@ public class NotificationSchedulerIntentService extends InjectingJobIntentServic
@Inject NotificationManager notificationManager;
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);
JobIntentService.enqueueWork(
context,

Loading…
Cancel
Save