Loading app/src/main/java/foundation/e/drive/services/InitializerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -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 ); Loading app/src/main/java/foundation/e/drive/services/ObserverService.java +7 −4 Original line number Diff line number Diff line Loading @@ -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, ""); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -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(); Loading app/src/main/java/foundation/e/drive/services/OperationManagerService.java +5 −15 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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(); } Loading Loading @@ -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") ); Loading Loading
app/src/main/java/foundation/e/drive/services/InitializerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -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 ); Loading
app/src/main/java/foundation/e/drive/services/ObserverService.java +7 −4 Original line number Diff line number Diff line Loading @@ -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, ""); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -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(); Loading
app/src/main/java/foundation/e/drive/services/OperationManagerService.java +5 −15 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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(); } Loading Loading @@ -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") ); Loading