Removed commented code
[pub/Android/ownCloud.git] / src / com / owncloud / android / services / OperationsService.java
index a638848..ce80b57 100644 (file)
@@ -388,13 +388,19 @@ public class OperationsService extends Service {
             }
         }
 
             }
         }
 
-        public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
+        public boolean dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
             Pair<RemoteOperation, RemoteOperationResult> undispatched = 
                     mUndispatchedFinishedOperations.remove(operationId);
             if (undispatched != null) {
                 listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
             Pair<RemoteOperation, RemoteOperationResult> undispatched = 
                     mUndispatchedFinishedOperations.remove(operationId);
             if (undispatched != null) {
                 listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
+                return true;
                 //Log_OC.wtf(TAG, "Sending callback later");
             } else {
                 //Log_OC.wtf(TAG, "Sending callback later");
             } else {
+                if (!mPendingOperations.isEmpty()) {
+                    return true;
+                } else {
+                    return false;
+                }
                 //Log_OC.wtf(TAG, "Not finished yet");
             }
         }
                 //Log_OC.wtf(TAG, "Not finished yet");
             }
         }