AlarmScheduler implements Scheduler { @Override public void reschedule(@NonNull Context context, @NonNull JobInfo jobInfo, int scheduleId, @Nullable Bundle extras) throws SchedulerException { long backOff = extras != null ? extras.getLong(EXTRA_BACKOFF_DELAY, 0) : 0; if (backOff <= 0) { backOff = DEFAULT_STARTING_BACK_OFF_TIME_MS; } else { backOff = Math.min(backOff * 2, DEFAULT_MAX_BACK_OFF_TIME_MS); } scheduleIntent(context, jobInfo, scheduleId, backOff); }  @Override void cancel(@NonNull Context context, int scheduleId); @Override void schedule(@NonNull Context context, @NonNull JobInfo jobInfo, int id); @Override void reschedule(@NonNull Context context, @NonNull JobInfo jobInfo, int scheduleId, @Nullable Bundle extras);  }
@Test public void testReschedule() throws SchedulerException { JobInfo jobInfo = JobInfo.newBuilder() .setAction("Some action") .build(); Bundle extras = new Bundle(); extras.putLong(AlarmScheduler.EXTRA_BACKOFF_DELAY, 1000); scheduler.reschedule(context, jobInfo, 30, extras); verifyScheduledJob(jobInfo, 30, 1000 * 2); }