X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/e373f0c3b1466a8070172f387552622eb7c9b885..185aae4bc345f453479f94e2a78da62e8c9930b0:/src/com/owncloud/android/services/OperationsService.java diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index eeda5e9d..ce80b57e 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -172,10 +172,10 @@ public class OperationsService extends Service { @Override public void onDestroy() { //Log_OC.wtf(TAG, "onDestroy init" ); - super.onDestroy(); //Log_OC.wtf(TAG, "Clear mUndispatchedFinisiedOperations" ); mUndispatchedFinishedOperations.clear(); //Log_OC.wtf(TAG, "onDestroy end" ); + super.onDestroy(); } @@ -388,13 +388,19 @@ public class OperationsService extends Service { } } - public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) { + public boolean dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) { Pair undispatched = mUndispatchedFinishedOperations.remove(operationId); if (undispatched != null) { listener.onRemoteOperationFinish(undispatched.first, undispatched.second); + return true; //Log_OC.wtf(TAG, "Sending callback later"); } else { + if (!mPendingOperations.isEmpty()) { + return true; + } else { + return false; + } //Log_OC.wtf(TAG, "Not finished yet"); } } @@ -472,20 +478,20 @@ public class OperationsService extends Service { } else { result = mCurrentOperation.execute(mOwnCloudClient); } - + } catch (AccountsException e) { if (mLastTarget.mAccount == null) { - Log_OC.e(TAG, "Error while trying to get autorization for a NULL account", e); + Log_OC.e(TAG, "Error while trying to get authorization for a NULL account", e); } else { - Log_OC.e(TAG, "Error while trying to get autorization for " + mLastTarget.mAccount.name, e); + Log_OC.e(TAG, "Error while trying to get authorization for " + mLastTarget.mAccount.name, e); } result = new RemoteOperationResult(e); } catch (IOException e) { if (mLastTarget.mAccount == null) { - Log_OC.e(TAG, "Error while trying to get autorization for a NULL account", e); + Log_OC.e(TAG, "Error while trying to get authorization for a NULL account", e); } else { - Log_OC.e(TAG, "Error while trying to get autorization for " + mLastTarget.mAccount.name, e); + Log_OC.e(TAG, "Error while trying to get authorization for " + mLastTarget.mAccount.name, e); } result = new RemoteOperationResult(e); } catch (Exception e) {