Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used: 1.0.0-alpha1
Devices/Android versions reproduced on: API 21+
When using WorkManager on a device that has JobScheduler, WorkManager will internally manage assigning integer IDs to the jobs it creates. This can be problematic when integrating WorkManager (or libraries that use it) with an app that already uses the JobScheduler API and assigns its own IDs to jobs - in the current implementation, there's no way to prevent WorkManager from using IDs that the app has already used, or vice-versa.
It would be nice to have a way to tell WorkManager to not use certain IDs - either by reserving a number range or by reserving individual IDs.
An API might look like the following:
WorkManager.initialize(context, new Configuration.Builder()
.skipJobSchedulerIdsBetween(MyJobIds.MIN_INCLUSIVE, MyJobIds.MAX_EXCLUSIVE)
.build());