Class ShadowJobService


@Implements(value=android.app.job.JobService.class, minSdk=21) public class ShadowJobService extends ShadowService
  • Constructor Details

    • ShadowJobService

      public ShadowJobService()
  • Method Details

    • jobFinished

      @Implementation protected void jobFinished(JobParameters params, boolean needsReschedule)
    • setNotification

      @Implementation(minSdk=34) protected void setNotification(JobParameters params, int notificationId, Notification notification, int jobEndNotificationPolicy)
      Stubbed out for now, as the real implementation throws an NPE when executed in Robolectric.
    • updateEstimatedNetworkBytes

      @Implementation(minSdk=34) protected void updateEstimatedNetworkBytes(JobParameters params, long downloadBytes, long uploadBytes)
      Stubbed out for now, as the real implementation throws an NPE when executed in Robolectric.
    • updateTransferredNetworkBytes

      @Implementation(minSdk=34) protected void updateTransferredNetworkBytes(JobParameters params, long downloadBytes, long uploadBytes)
      Stubbed out for now, as the real implementation throws an NPE when executed in Robolectric.
    • getIsJobFinished

      public boolean getIsJobFinished()
      Returns whether the job has finished running. When using this shadow this returns true after jobFinished(JobParameters, boolean) is called.
    • getIsRescheduleNeeded

      public boolean getIsRescheduleNeeded()
      Returns whether the job needs to be rescheduled. When using this shadow it returns the last value passed into jobFinished(JobParameters, boolean).