diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-09-06 16:47:17 +0200 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-09-06 16:49:12 +0200 |
commit | 7cf75c7cac92ebd7f382f228af40bdb98cbed437 (patch) | |
tree | 83b93f67212d1f38a06a81b31cfc586ef7e60a24 /core | |
parent | 9512c0133f09c783837d4e048a72619c854602c2 (diff) | |
download | AntennaPod-7cf75c7cac92ebd7f382f228af40bdb98cbed437.zip |
2815 Enqueue jobs with a unique job id per class
As Job IDs must be unique per uid, use IDs that no one else will use...
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java | 5 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java index de040603d..fe6e8c400 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/GpodnetSyncService.java @@ -45,6 +45,7 @@ import de.danoeh.antennapod.core.util.gui.NotificationUtils; * This class also provides static methods for starting the GpodnetSyncService. */ public class GpodnetSyncService extends JobIntentService { + private static final String TAG = "GpodnetSyncService"; private static final long WAIT_INTERVAL = 5000L; @@ -61,8 +62,10 @@ public class GpodnetSyncService extends JobIntentService { private static boolean syncSubscriptions = false; private static boolean syncActions = false; + private static final int JOB_ID = -17000; + private static void enqueueWork(Context context, Intent intent) { - enqueueWork(context, GpodnetSyncService.class, 0, intent); + enqueueWork(context, GpodnetSyncService.class, JOB_ID, intent); } @Override diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index 2fd790ac7..4f0da82fb 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -26,13 +26,16 @@ import de.danoeh.antennapod.core.receiver.PlayerWidget; * Updates the state of the player widget */ public class PlayerWidgetJobService extends JobIntentService { + private static final String TAG = "PlayerWidgetJobService"; private PlaybackService playbackService; private final Object waitForService = new Object(); + private static final int JOB_ID = -17001; + public static void updateWidget(Context context) { - enqueueWork(context, PlayerWidgetJobService.class, 0, new Intent(context, PlayerWidgetJobService.class)); + enqueueWork(context, PlayerWidgetJobService.class, JOB_ID, new Intent(context, PlayerWidgetJobService.class)); } @Override |