diff --git a/app/src/main/java/org/tasks/injection/InjectingJobIntentService.java b/app/src/main/java/org/tasks/injection/InjectingJobIntentService.java index 364d3a082..edb4ddba3 100644 --- a/app/src/main/java/org/tasks/injection/InjectingJobIntentService.java +++ b/app/src/main/java/org/tasks/injection/InjectingJobIntentService.java @@ -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) { diff --git a/app/src/main/java/org/tasks/jobs/AfterSaveIntentService.java b/app/src/main/java/org/tasks/jobs/AfterSaveIntentService.java index 934a19fa4..2b32c8692 100644 --- a/app/src/main/java/org/tasks/jobs/AfterSaveIntentService.java +++ b/app/src/main/java/org/tasks/jobs/AfterSaveIntentService.java @@ -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 diff --git a/app/src/main/java/org/tasks/scheduling/BackgroundScheduler.java b/app/src/main/java/org/tasks/scheduling/BackgroundScheduler.java index 14f2efa1a..9c4cb05db 100644 --- a/app/src/main/java/org/tasks/scheduling/BackgroundScheduler.java +++ b/app/src/main/java/org/tasks/scheduling/BackgroundScheduler.java @@ -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 diff --git a/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java b/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java index 4802f0fde..d042b6e72 100644 --- a/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java +++ b/app/src/main/java/org/tasks/scheduling/CalendarNotificationIntentService.java @@ -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 diff --git a/app/src/main/java/org/tasks/scheduling/GeofenceSchedulingIntentService.java b/app/src/main/java/org/tasks/scheduling/GeofenceSchedulingIntentService.java index 99351a6d0..20e899ff9 100644 --- a/app/src/main/java/org/tasks/scheduling/GeofenceSchedulingIntentService.java +++ b/app/src/main/java/org/tasks/scheduling/GeofenceSchedulingIntentService.java @@ -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 diff --git a/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java b/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java index 691ec1ff0..75129b00c 100644 --- a/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java +++ b/app/src/main/java/org/tasks/scheduling/NotificationSchedulerIntentService.java @@ -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,