Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

continue whit old code for schedule scanner job

parent 590fa448
Loading
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -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");
        }
    }

    /**