Commit 805530d7 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer 🎼
Browse files

Merge branch 'issue_123_timeScheduler_new' into 'oreo_fileObserver'

Issue 123 time scheduler new

See merge request !49
parents 799ae4ea 62ef326f
Pipeline #148110 passed with stage
in 58 seconds
image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest"
image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:legacy"
stages:
- build
......
......@@ -9,11 +9,13 @@ import android.util.Log;
import java.io.IOException;
import foundation.e.drive.services.InitializerService;
public class ConnectivityReceiver
extends BroadcastReceiver {
public static ConnectivityReceiverListener connectivityReceiverListener;
final private String TAG = InitializerService.class.getSimpleName();
public ConnectivityReceiver() {
super();
}
......@@ -42,7 +44,7 @@ public class ConnectivityReceiver
&& activeNetwork.isConnectedOrConnecting();
//if (connectivityReceiverListener != null) {
Log.e("TAG", "ConnectivityReceiver onNetworkConnectionChanged...." + isConnected);
Log.e(TAG, "ConnectivityReceiver onNetworkConnectionChanged...." + isConnected);
//connectivityReceiverListener.onNetworkConnectionChanged(isConnected);
//}
}
......
......@@ -343,7 +343,7 @@ public class InitializerService extends Service
public void onNetworkConnectionChanged(boolean isConnected) {
//just for testing code for now
Log.e("TAG", "onNetworkConnectionChanged...." + isConnected);
Log.e(TAG, "onNetworkConnectionChanged...." + isConnected);
}
}
\ No newline at end of file
......@@ -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) //2 hr
.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");
}
}
/**
......
Markdown is supported
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