v1.1.11 exact jobs firing with delay on Doze Mode
See original GitHub issueHi, I’m trying to run an exact job 2min after it was scheduled but it has some delay when testing it with doze.
new JobRequest.Builder(GeofenceLimboJob.TAG).setExact(TimeUnit.MINUTES.toMillis(2)).setUpdateCurrent(true).build().schedule();
10-03 11:10:33.366 5502-14196/ D/JobProxy14: Scheduled alarm, request{id=15, tag=job_geofence_limbo_tag}, delay 00:02:00, exact true, reschedule count 0
10-03 11:14:24.707 5502-20670/ D/PlatformAlarmService: Run job, request{id=15, tag=job_geofence_limbo_tag}, waited 00:03:51, delay 00:02:00
10-03 11:14:24.727 5502-20670/ I/JobExecutor: Executing request{id=15, tag=job_geofence_limbo_tag}, context PlatformAlarmService
10-03 11:14:24.773 5502-20672/ I/JobExecutor: Finished job{id=15, finished=true, result=SUCCESS, canceled=false, periodic=false, class=GeofenceLimboJob, tag=job_geofence_limbo_tag}
10-03 11:14:24.776 5502-20670/ D/PlatformAlarmService: Finished job, request{id=15, tag=job_geofence_limbo_tag} SUCCESS
Right after the job is scheduled i’m putting the device in IDLE state through the adb. As you can see, there is an delay almost twice the time i’ve set the alarm. Is this the expected behaviour? From what I’ve understood, since this uses AlarmManager it should wake the device after the 2min.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
So, I had a deeper look at this and it seems that it is indeed an limitation of the setExactAndAllowWhileIdle method, which is what seems to be user by your library for exact jobs with SDK > 23.
So, when I reduced the frequency that I was scheduling this job the delay disappeared.
Thank you for the information regarding the AlarmManager restrictions.
Awesome, thanks for sharing your findings.