Commit 9c43a9d8 authored by narinder Rana's avatar narinder Rana
Browse files

continue whit old code for schedule scanner job

parent 590fa448
Pipeline #128429 passed with stage
in 3 minutes and 8 seconds
......@@ -32,23 +32,23 @@ public abstract class JobUtils {
*/
public static void scheduleScannerJob(Context context){
Log.i(TAG, "scheduleJob");
Log.i(TAG, "scheduleJob task off");
/* I. Start periodic checkup */
// ComponentName jobService = new ComponentName( context, ScannerJob.class );
//
// JobInfo job = new JobInfo.Builder(ScannerJobId, jobService )
// .setPeriodic(1860000, 30000) //31git minutes and 30 secondes
// .setPersisted(true)
// .setRequiredNetworkType( JobInfo.NETWORK_TYPE_ANY )
// .build();
//
// JobScheduler jobScheduler = context.getSystemService( JobScheduler.class );
//
// if ( jobScheduler.schedule( job ) == JobScheduler.RESULT_SUCCESS ) {
// Log.d(TAG, "Scheduled job created");
// } else {
// Log.e(TAG, "Scheduled job not created");
// }
ComponentName jobService = new ComponentName( context, ScannerJob.class );
JobInfo job = new JobInfo.Builder(ScannerJobId, jobService )
.setPeriodic(7200000 , 30000) //31git minutes and 30 secondes
.setPersisted(true)
.setRequiredNetworkType( JobInfo.NETWORK_TYPE_ANY )
.build();
JobScheduler jobScheduler = context.getSystemService( JobScheduler.class );
if ( jobScheduler.schedule( job ) == JobScheduler.RESULT_SUCCESS ) {
Log.d(TAG, "Scheduled job created");
} else {
Log.e(TAG, "Scheduled job not created");
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment