private boolean areNetworkConstraintsSatisfied(@JobConstraint int jobConstraints) {

    // Network constraints are always satisfied for jobs that don't need a network
    if (!wantsNetwork(jobConstraints)) {
      return true;
    }

    // Ensure basic network connectivity is available.
    ConnectivityManager connectivityManager =
        (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    if (!isNetworkConnected(connectivityManager)) {
      return false;
    }

    // Note: Constraint.ON_ANY_NETWORK and Constraint.ON_UNMETERED_NETWORK are mutually exclusive.
    // Constraints satisfied if we don't need an unmetered network (as that implies any network is
    // OK) or current network is unmetered.
    return !wantsUnmeteredNetwork(jobConstraints) || isNetworkUnmetered(connectivityManager);
  }
Returns true if the specified jobConstraints are satisfied. We only check whether network
constraints are satisfied. All other constraints are assumed to be satisfied.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/ConstraintChecker.java