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
long interval = 900000; // 15 minutes
long flexInterval = (interval / 2);
workRequestBuilder = new PeriodicWorkRequest.Builder(MyWorker.class, interval, TimeUnit.MILLISECONDS, flexInterval, TimeUnit.MILLISECONDS);
When I enqueue this on my Android 7 device, the first periodic work does not fire immediately, but as expected only fires halfway through the interval, when the flex period starts.
But when this is enqueued on an Android 4 device (I'm using an Android 4.3 emulator but I noticed this first on a user's real Android 4.3 device), the first periodic work fires IMMEDIATELY.
Seems like flexInterval is not properly taken into account pre Android 5 (based on AlarmManager)??