synchronized void unbind() {
    if (!wasUnbound()) {
      binder = null;
      wasUnbound = true;

      try {
        context.unbindService(this);
      } catch (IllegalArgumentException e) {
        Log.w(TAG, "Error unbinding service: " + e.getMessage());
      }

      List<JobInvocation> jobsToFinish = new ArrayList<>(jobStatuses.size());

      Iterator<JobInvocation> pendingJobsIterator = jobStatuses.keySet().iterator();
      while (pendingJobsIterator.hasNext()) {
        jobsToFinish.add(pendingJobsIterator.next());
        pendingJobsIterator.remove();
      }

      for (JobInvocation job : jobsToFinish) {
        requestRetryForJob(job);
      }
    }
  }
Stops provided {@link JobInvocation job}.

<p>Unbinds the service if {@code needToSendResult} is {@code false} and no other jobs are
running.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobServiceConnection.java