Commit 3cc6bebb authored by narinder Rana's avatar narinder Rana
Browse files

check file list onScreenReceiver and call to observerService

parent 91470b83
Pipeline #135496 failed with stage
in 36 seconds
......@@ -11,7 +11,10 @@ package foundation.e.drive.receivers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import foundation.e.drive.services.InitializerService;
import foundation.e.drive.services.ObserverService;
import foundation.e.drive.utils.CommonUtils;
......@@ -38,7 +41,19 @@ public class ScreenOffReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "onReceive");
// i will use this code for check file sync list
if(InitializerService.files.size()!=0){
try {
Intent observersServiceIntent = new Intent(context, foundation.e.drive.services.ObserverService.class);
Bundle mBundle = new Bundle();
mBundle.putBoolean("isFileObserverService", true);
observersServiceIntent.putExtras(mBundle);
context.startService(observersServiceIntent);
}catch (Exception exception){
exception.printStackTrace();
}
}
/*String intentAction = intent.getAction();
if(intentAction == null){
......
......@@ -130,7 +130,6 @@ public class FileObserverService extends Service {
super.onPostExecute(s);
try {
Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
Bundle mBundle = new Bundle();
mBundle.putBoolean("isFileObserverService", true);
// mBundle.putByteArray("fileObserverObject", CommonUtils.convertToBytes(new foundation.e.drive.models.FileObserver(files)));
......
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