
Request.updateStats( true, true ) // updates the database value, but fails in this case assertThat(request.getFailureCount()).isEqualTo( 1 ) // in memory value was updated, keep that assertThat(request.getLastRun()).isGreaterThan( 0 ) getJobStorage ().injectDatabase(database) When(database.update(anyString(), any(ContentValues. SQLiteDatabase database = mock(SQLiteDatabase.

Parameters: exactInMs - The exact offset when the job should run from when the job was scheduled. No exception is thrown if the argument is greater than the maximum value, the argument is The maximum value of the argument is Long.MAX_VALUE / 3 * 2 (about 53_375_995_583 days).

The milliseconds specified are treated as offset from now, e.g. Internally an exact job is always using the The exact timing is the most important requirement for such a job. It's also not allowed to specify any requirement, Note that an exact job can't be periodic. This type of job must only be usedįor situations where it is actually required that the alarm go off even while in idle.Ī reasonable example would be for a calendar notification that should make a sound so Specify that the job should run at an exact time. setExtras public JobRequest.Builder setExtras( PersistableBundleCompat extras).endInMs - Latest point at which your task must be run. Parameters: startInMs - Earliest point from which your task is eligible to run. Runs on pre Android 5.0 devices, if one argument is too large. The arithmetic average of startInMs and endInMs. Although being inexact, the execution time is The AlarmManager usedĪs fallback API doesn't allow setting a start date. NOTE: It's not recommended to have such big execution windows. Than the maximum value, the arguments are silently being clamped. No exception is thrown if an argument is greater Otherwise some APIs schedule the job immediately. The maximum value for each argument is Long.MAX_VALUE / 3 * 2 (about 53_375_995_583 days). System.currentTimeMillis() + startInMs and

The window specified is treated as offset from now, e.g. One-off tasks, but it's not allowed to call this method together with Note that it's mandatory to set a time for Set the time window when the job will be run.
