Loading app/src/main/java/foundation/e/drive/services/OperationManagerService.java +44 −43 Original line number Diff line number Diff line Loading @@ -229,28 +229,32 @@ public class OperationManagerService extends Service implements OnRemoteOperatio Log.i(TAG, "onStartCommand()"); CommonUtils.setServiceUnCaughtExceptionHandler(this); if(intent == null || intent.getExtras() == null){ Log.w(TAG, "Intent or it's extras is null."); return super.onStartCommand(intent, flags, startId); } Bundle extras = intent.getExtras(); Log.d(TAG, "OperationManagerService recieved "+(extras == null ? "null extras": extras.size()+" operations to perform") ); if(extras != null) { //Load operation from intent this.mOperationsQueue = new ConcurrentLinkedDeque<>(); for (String key : extras.keySet()) { Parcelable parcelableObject = extras.getParcelable(key); String parcelableClassName = parcelableObject.getClass().getSimpleName(); if(key.equals("account")){ this.mAccount = (Account) parcelableObject; mAccount = (Account) parcelableObject; } else if (parcelableObject.getClass().getName().equals(DownloadFileOperation.class.getName())) { else if (parcelableClassName.equals(DownloadFileOperation.class.getSimpleName())) { DownloadFileOperation download = (DownloadFileOperation) parcelableObject; download.setContext(getApplicationContext()); mOperationsQueue.add(download); } else if (parcelableObject.getClass().getName().equals(UploadFileOperation.class.getName())) { } else if (parcelableClassName.equals(UploadFileOperation.class.getSimpleName())) { UploadFileOperation upload = (UploadFileOperation) parcelableObject; upload.setContext(getApplicationContext()); mOperationsQueue.add(upload); } else if (parcelableObject.getClass().getName().equals(RemoveFileOperation.class.getName())) { } else if (parcelableClassName.equals(RemoveFileOperation.class.getSimpleName())) { mOperationsQueue.add((RemoveFileOperation) parcelableObject); } } Loading Loading @@ -279,9 +283,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio Log.w(TAG, "No Client, Can't Work!"); stopSelf(); } }else{ Log.w(TAG, "Intent's extras is null."); } return super.onStartCommand(intent, flags, startId); } Loading Loading
app/src/main/java/foundation/e/drive/services/OperationManagerService.java +44 −43 Original line number Diff line number Diff line Loading @@ -229,28 +229,32 @@ public class OperationManagerService extends Service implements OnRemoteOperatio Log.i(TAG, "onStartCommand()"); CommonUtils.setServiceUnCaughtExceptionHandler(this); if(intent == null || intent.getExtras() == null){ Log.w(TAG, "Intent or it's extras is null."); return super.onStartCommand(intent, flags, startId); } Bundle extras = intent.getExtras(); Log.d(TAG, "OperationManagerService recieved "+(extras == null ? "null extras": extras.size()+" operations to perform") ); if(extras != null) { //Load operation from intent this.mOperationsQueue = new ConcurrentLinkedDeque<>(); for (String key : extras.keySet()) { Parcelable parcelableObject = extras.getParcelable(key); String parcelableClassName = parcelableObject.getClass().getSimpleName(); if(key.equals("account")){ this.mAccount = (Account) parcelableObject; mAccount = (Account) parcelableObject; } else if (parcelableObject.getClass().getName().equals(DownloadFileOperation.class.getName())) { else if (parcelableClassName.equals(DownloadFileOperation.class.getSimpleName())) { DownloadFileOperation download = (DownloadFileOperation) parcelableObject; download.setContext(getApplicationContext()); mOperationsQueue.add(download); } else if (parcelableObject.getClass().getName().equals(UploadFileOperation.class.getName())) { } else if (parcelableClassName.equals(UploadFileOperation.class.getSimpleName())) { UploadFileOperation upload = (UploadFileOperation) parcelableObject; upload.setContext(getApplicationContext()); mOperationsQueue.add(upload); } else if (parcelableObject.getClass().getName().equals(RemoveFileOperation.class.getName())) { } else if (parcelableClassName.equals(RemoveFileOperation.class.getSimpleName())) { mOperationsQueue.add((RemoveFileOperation) parcelableObject); } } Loading Loading @@ -279,9 +283,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio Log.w(TAG, "No Client, Can't Work!"); stopSelf(); } }else{ Log.w(TAG, "Intent's extras is null."); } return super.onStartCommand(intent, flags, startId); } Loading