X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8d38fd331d43f21800843ae4cf340bc33e583a40..12bbc51dcbb7eccf4189dcc8f7d9c20aa634aad9:/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 a9f92ed6..bbecf21a 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -261,9 +261,9 @@ public class OperationsService extends Service { * Creates and adds to the queue a new operation, as described by operationIntent * * @param operationIntent Intent describing a new operation to queue and execute. - * @return Identifier of the operation created, or -1 if failed. + * @return Identifier of the operation created, or null if failed. */ - public int newOperation(Intent operationIntent) { + public long newOperation(Intent operationIntent) { RemoteOperation operation = null; Target target = null; try { @@ -347,24 +347,15 @@ public class OperationsService extends Service { mPendingOperations.add(new Pair(target, operation)); startService(new Intent(OperationsService.this, OperationsService.class)); Log_OC.wtf(TAG, "New operation added, opId: " + operation.hashCode()); + // better id than hash? ; should be good enough by the time being return operation.hashCode(); } else { - Log_OC.wtf(TAG, "New operation failed, returned -1"); - return -1; + Log_OC.wtf(TAG, "New operation failed, returned Long.MAX_VALUE"); + return Long.MAX_VALUE; } } - public RemoteOperationResult getOperationResultIfFinished(int operationId) { - Pair undispatched = - mUndispatchedFinishedOperations.remove(operationId); - if (undispatched != null) { - return undispatched.second; - } - return null; - } - - public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) { Pair undispatched = mUndispatchedFinishedOperations.remove(operationId);