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

Commit ca9870ed authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

fix generation of multiple file

parent 55960ca1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -66,8 +66,11 @@ public class InitializerService extends Service implements OnRemoteOperationList
    public int onStartCommand( Intent intent, int flags, int startId ) {
        Log.i(TAG, "onStartCommand(...)");

        if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
            Log.d("ObserverService", "ServiceExceptionHandler already set!");
        }else{
            Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));

        }
        //Get account
        SharedPreferences prefs = this.getSharedPreferences( AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE );

+7 −4
Original line number Diff line number Diff line
@@ -80,8 +80,11 @@ public class ObserverService extends Service implements OnRemoteOperationListene
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(TAG, "onStartCommand("+startId+")");

        if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
            Log.d("ObserverService", "ServiceExceptionHandler already set!");
        }else{
            Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));

        }
        SharedPreferences prefs = this.getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE);
        String accountName = prefs.getString(AccountManager.KEY_ACCOUNT_NAME, "");
        String accountType = prefs.getString(AccountManager.KEY_ACCOUNT_TYPE, "");
@@ -142,7 +145,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
        return super.onStartCommand( intent, flags, startId );
    }

    /* Common methods */
    //Common methods
    /**
     * Start to bind this service to OperationManagerService or start scan if binding is already set.
     * Method to factorise code that is called from different place
@@ -198,7 +201,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene
        }
        Log.d(TAG, logFolderList.toString());


        if (remote) {
            OwnCloudClient client = DavClientProvider.getInstance().getClientInstance(mAccount, getApplicationContext());
            if (client != null) {
@@ -246,6 +248,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
    @Override
    public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result ) {
        Log.i( TAG, "onRemoteOperationFinish()" );

        if( operation instanceof ListFileRemoteOperation){
            if( result.isSuccess() ){
                List<Object> resultDatas = result.getData();
+5 −15
Original line number Diff line number Diff line
@@ -13,13 +13,11 @@ import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Parcelable;
import android.preference.Preference;
import android.support.annotation.Nullable;
import android.util.Log;
import com.owncloud.android.lib.common.OwnCloudClient;
@@ -27,7 +25,6 @@ import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;

import org.apache.commons.httpclient.util.DateUtil;

import java.lang.ref.WeakReference;
import java.util.Hashtable;
@@ -61,16 +58,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
    @Override
    public void onDestroy() {
        Log.i(TAG, "onDestroy()");

        /*this.mOperationsQueue.clear();
        for(int i =-1, size = mThreadPool.length;++i < size;){
            try{
                if(mThreadPool[i] != null)
                    mThreadPool[i].interrupt();}
            catch(Exception e){
                Log.e(TAG, e.toString());
            }
        }*/
        super.onDestroy();
    }

@@ -240,8 +227,11 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(TAG, "onStartCommand()");
        if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
            Log.d("ObserverService", "ServiceExceptionHandler already set!");
        }else{
            Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));

        }
        Bundle extras = intent.getExtras();
        Log.d(TAG, "OperationManagerService recieved "+(extras == null ? "null extras": extras.size()+" operations to perform") );