@Test public void testAreConstraintsSatisfied_anyNetworkRequired_satisfied_includesNonNetworkConstraints() { JobInvocation job = jobBuilder .setConstraints( Constraint.uncompact( Constraint.DEVICE_IDLE | Constraint.DEVICE_CHARGING | Constraint.ON_ANY_NETWORK)) .build(); shadowNetworkInfo.setConnectionStatus( true); assertThat(constraintChecker.areConstraintsSatisfied(job)).isTrue(); }
public boolean areConstraintsSatisfied(JobInvocation job) { int jobConstraints = Constraint.compact(job.getConstraints()); return areNetworkConstraintsSatisfied(jobConstraints); }
ConstraintChecker { public boolean areConstraintsSatisfied(JobInvocation job) { int jobConstraints = Constraint.compact(job.getConstraints()); return areNetworkConstraintsSatisfied(jobConstraints); } }
ConstraintChecker { public boolean areConstraintsSatisfied(JobInvocation job) { int jobConstraints = Constraint.compact(job.getConstraints()); return areNetworkConstraintsSatisfied(jobConstraints); } ConstraintChecker(Context context); }
ConstraintChecker { public boolean areConstraintsSatisfied(JobInvocation job) { int jobConstraints = Constraint.compact(job.getConstraints()); return areNetworkConstraintsSatisfied(jobConstraints); } ConstraintChecker(Context context); boolean areConstraintsSatisfied(JobInvocation job); }
ConstraintChecker { public boolean areConstraintsSatisfied(JobInvocation job) { int jobConstraints = Constraint.compact(job.getConstraints()); return areNetworkConstraintsSatisfied(jobConstraints); } ConstraintChecker(Context context); boolean areConstraintsSatisfied(JobInvocation job);  }