Android JobScheduler: JobService with network constraint start even if my device have no network connection.
<p>I try to implement JobScheduler in my app, but I have an issue that I can't understand.</p>

<p>The goal is to start a service when internet connection is available on my device, within interval of 10 secondes. </p>

<p>So i use a JobScheduler in this way:</p>

<pre><code>    JobScheduler mJobScheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
    JobInfo.Builder builder = new JobInfo.Builder(1, new ComponentName(getPackageName(),
            MyJobService.class.getName()))
            .setRequiredNetworkType(NETWORK_TYPE_ANY)
            .setPeriodic(10 * 1000);


    if (mJobScheduler.schedule(builder.build()) &lt;= 0) {
        Log.e("gch", "can't Schedule job for MyJobService");
    } else {
        Log.d("gch", "Schedule job for MyJobService");
    }
</code></pre>

<p>And my JobService:</p>

<pre><code>public class MyJobService extends android.app.job.JobService {
    public MyJobService() {
    }

    @Override
    public boolean onStartJob(JobParameters jobParameters) {
        Log.d("gch", "onStartJob");
        return false;
    }

    @Override
    public boolean onStopJob(JobParameters jobParameters) {
        Log.d("gch", "onStartonStopJob");
        return true;
    }

}
</code></pre>

<p>Of course I added the <code>android:permission="android.permission.BIND_JOB_SERVICE"</code> </p>

<p>If I understand properly, my JobService should be executed only if my device have network, and at most once within 10s. </p>

<p>But, on my device, I have no internet connection (no SIM card inserted, and WIFI is not able) BUT my job is executed every 10s..
It seems NETWORK_TYPE_ANY is ignored. Same issue with NETWORK_TYPE_UNMETERED.</p>

<p>Somebody already facing to this issue ? </p>

<p>Thank a lot. </p>