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

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

update for testing

parent 2a75778b
Loading
Loading
Loading
Loading
Loading
+25 −14
Original line number Diff line number Diff line
@@ -63,10 +63,13 @@ 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());

                    if(!file.isDirectory()){
                       // if(!InitializerService.files.contains(file)){

                            InitializerService.files.add(file);
                    }
                       // }
                        if(!ConnectivityReceiver.isConnected()){
                            InitializerService.fileObserverFlag=true;
                        }
@@ -80,6 +83,8 @@ public class FileObserverService extends Service {
                        {
                            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);
+4 −4
Original line number Diff line number Diff line
@@ -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));
+3 −0
Original line number Diff line number Diff line
@@ -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;){

+1 −1
Original line number Diff line number Diff line
@@ -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