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

Commit 2cf38162 authored by narinder Rana's avatar narinder Rana
Browse files

now it's working

parent 0f69bbb2
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ http://www.gnu.org/licenses/gpl.html
        android:allowBackup="true"
        android:icon="@mipmap/ic_eelo"
        android:label="@string/app_name"

        android:roundIcon="@mipmap/ic_eelo_round">
        <!-- Providers -->
        <provider
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public class UploadFileOperation extends RemoteOperation implements ComparableOp
        //if upload is a success
        if( uploadResult.isSuccess() ){

            InitializerService.files.remove(file);
          //  InitializerService.files.remove(file);

            Object data = uploadResult.getSingleData();
            if(data != null){
+11 −11
Original line number Diff line number Diff line
@@ -42,17 +42,17 @@ public class ScreenOffReceiver extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "onReceive");

        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();
            }
        }
//        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();
+6 −6
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ public class FileObserverService extends Service {
    private final static String TAG = FileObserverService.class.getSimpleName();
    RecursiveFileObserver mFileObserver = null;
    private int observerFlag=-1;
    //List<SyncedFileState> syncedFileStatesList=new ArrayList<>();
    List<File> files=new ArrayList<>();


    @Override
@@ -66,10 +66,10 @@ public class FileObserverService extends Service {
                    Log.e("TAG", "file.isDirectory() ...."+file+"......"+file.isDirectory());

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

                            InitializerService.files.add(file);
                       // }
                            files.add(file);
                        }
                        if(!ConnectivityReceiver.isConnected()){
                            InitializerService.fileObserverFlag=true;
                        }
@@ -134,14 +134,14 @@ public class FileObserverService extends Service {
            try {
                Log.e("Tag", "onPostExecute..........");

                for(File f:InitializerService.files){
                for(File f: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);
               // mBundle.putByteArray("fileObserverObject", CommonUtils.convertToBytes(new foundation.e.drive.models.FileObserver(files)));
                mBundle.putByteArray("fileObserverObject", CommonUtils.convertToBytes(new foundation.e.drive.models.FileObserver(files)));
                observersServiceIntent.putExtras(mBundle);
                startService(observersServiceIntent);
            }catch (Exception exception){
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public class InitializerService extends Service
    private int restartFolderCreationCounter =0;
    private ConnectivityReceiver connectivityReceiver;

    public static List<File> files=new ArrayList<>();
   // public static List<File> files=new ArrayList<>();
    public static boolean schedulerFlag=false;
    public static boolean fileObserverFlag=false;

Loading