Commit 0f69bbb2 authored by narinder Rana's avatar narinder Rana
Browse files

update for testing

parent 2a75778b
Pipeline #136984 failed with stage
in 42 seconds
......@@ -63,23 +63,28 @@ public class FileObserverService extends Service {
if(event== FileObserver.CREATE || event==FileObserver.MODIFY || event== FileObserver.DELETE || event ==FileObserver.MOVED_TO){
Log.i(TAG, "...Event ..." + event+"...file ..." + file);
if(!InitializerService.files.contains(file)){
Log.e("TAG", "file.isDirectory() ...."+file+"......"+file.isDirectory());
InitializerService.files.add(file);
}
if(!ConnectivityReceiver.isConnected()){
InitializerService.fileObserverFlag=true;
}
try
{
if(observerFlag == -1){
new AsyncTaskRunner().execute("");
if(!file.isDirectory()){
// if(!InitializerService.files.contains(file)){
InitializerService.files.add(file);
// }
if(!ConnectivityReceiver.isConnected()){
InitializerService.fileObserverFlag=true;
}
try
{
if(observerFlag == -1){
new AsyncTaskRunner().execute("");
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
catch (Exception e)
{
e.printStackTrace();
}
......@@ -127,6 +132,12 @@ public class FileObserverService extends Service {
protected void onPostExecute(String s) {
super.onPostExecute(s);
try {
Log.e("Tag", "onPostExecute..........");
for(File f:InitializerService.files){
Log.e("TAG", "...........file name in post execute.."+f.getAbsolutePath());
}
Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
Bundle mBundle = new Bundle();
mBundle.putBoolean("isFileObserverService", true);
......
......@@ -301,8 +301,8 @@ public class InitializerService extends Service
.apply();
//all folder have been created
//JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId);
// JobUtils.scheduleScannerJob(appContext);
JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId);
JobUtils.scheduleScannerJob(appContext);
Log.d(TAG, "RegisterReceiver: screenOffReceiver");
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
......@@ -310,8 +310,8 @@ public class InitializerService extends Service
getApplicationContext().registerReceiver(ScreenOffReceiver.getInstance(), filter);
//Immediatly start ObserverService to not have to wait 30 minutes.
// Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
// startService(observersServiceIntent);
Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
startService(observersServiceIntent);
//start FileObserverService
startService(new Intent(this, FileObserverService.class));
......
......@@ -254,6 +254,8 @@ public class ObserverService extends Service implements OnRemoteOperationListene
} else {
if(isFileObserverService){
Log.e("TAG", "ObserverService..isFileObserverService...."+isFileObserverService);
// List<File> files = fileObserverObject.getFiles();
DbHelper.updateSyncedFolders(mSyncedFolders, this); //@ToDo: maybe do this when all contents will be synced.
......@@ -671,6 +673,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
Log.d(TAG, "Loop through local file list");
Log.v(TAG, "format: filePath, exist, lastModified) :");
Log.e("TAG", "ObserverService..handleLocalFiles....");
//Loop through local files
for(int i =-1, localFilesSize = localFileList.size(); ++i < localFilesSize;){
......
......@@ -24,7 +24,7 @@ import foundation.e.drive.jobs.ScannerJob;
public abstract class JobUtils {
final private static String TAG = JobUtils.class.getSimpleName(); //Tag for log
public final static int ScannerJobId = 3310;
//public final static int InitializerJobId = 3311;
public final static int InitializerJobId = 3311;
/**
* Start the scheduledJob for observing remote's folder
......
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