package com.njnu.kai.practice.job;

import android.support.annotation.NonNull;

import com.evernote.android.job.Job;
import com.evernote.android.job.JobRequest;
import com.njnu.kai.support.LogUtils;

/**
 * @author hongkai.qian
 * @version 1.0.0
 * @since 17/3/27
 */
public class DemoSyncJob extends Job {

    public static final String TAG = "job_demo_tag";

    @Override
    @NonNull
    protected Result onRunJob(Params params) {
        LogUtils.d(TAG, "onRunJob tid=%d", Thread.currentThread().getId());
        return Result.SUCCESS;
    }

    public static void scheduleJob() {
        new JobRequest.Builder(DemoSyncJob.TAG)
                .setExecutionWindow(30_000L, 40_000L)
                .build()
                .schedule();
    }
}

@@ -565,28 +565,106 @@
 tic 
-void scheduleJob() %7B
+int scheduleJob() %7B%0A        LogUtils.d(TAG, %22scheduleJob tid=%25d%22, Thread.currentThread().getId());
 %0A   
@@ -668,16 +668,23 @@
         
+return 
 new JobR
@@ -769,16 +769,182 @@
 0_000L)%0A
+                .setRequiredNetworkType(JobRequest.NetworkType.CONNECTED)%0A//                .setRequiresCharging(true)%0A//                .setRequiresDeviceIdle(true)%0A
         

test job again