googlearchive/android-JobScheduler

JobScheduler start job not triggered.

Closed this issue · 4 comments

Hi I have been using JobScheduler since 3months. Haven't faced any issue until yesterday. It seem there is a behaviour change in the way it works. Whenever i use jobscheduler.schedule(jobinfo) it used to trigger immediately but right now it take 5mins or more to trigger the Job Service. Can I know why is this happening?

jobInfo = new JobInfo.Builder(JOB_SERVICE_LOCATION_PROBE, new ComponentName(getApplicationContext(), LocationJob.class))
                                        .setBackoffCriteria(BACKGROUND_JOB_BACK_OFF, JobInfo.BACKOFF_POLICY_EXPONENTIAL)
                                        .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
                                        .setExtras(persistableBundle).build();

jobscheduler.schedule(jobInfo);

Can anyone comment on this?

try setting setMinimumLatency(0) explicitly.

Since Marshmallow the minimum time is set to 5 mins by the system itself. But wait! in Nougat+ is 15mins, so this api only works if you want a very inexact task

This sample has been deprecated/archived (check README for more information on newer samples related to this technology).

As recommended by GitHub, we are closing all issues and pull requests.