X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d860ae7cd462d08e3de523e2a6f29850bb8d2e96..7d16de3c0700bae4edec438ab833a819374566fc:/src/com/owncloud/android/services/SyncFolderHandler.java diff --git a/src/com/owncloud/android/services/SyncFolderHandler.java b/src/com/owncloud/android/services/SyncFolderHandler.java index b0116b32..319a1587 100644 --- a/src/com/owncloud/android/services/SyncFolderHandler.java +++ b/src/com/owncloud/android/services/SyncFolderHandler.java @@ -86,6 +86,8 @@ class SyncFolderHandler extends Handler { @Override public void handleMessage(Message msg) { Pair itemSyncKey = (Pair) msg.obj; + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Handling sync folder " + itemSyncKey.second); doOperation(itemSyncKey.first, itemSyncKey.second); mService.stopSelf(msg.arg1); } @@ -96,6 +98,8 @@ class SyncFolderHandler extends Handler { */ private void doOperation(Account account, String remotePath) { + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Getting sync folder " + remotePath); mCurrentSyncOperation = mPendingOperations.get(account, remotePath); if (mCurrentSyncOperation != null) { @@ -115,13 +119,18 @@ class SyncFolderHandler extends Handler { } // else, reuse client from previous operation + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Executing sync folder " + remotePath); result = mCurrentSyncOperation.execute(mOwnCloudClient, mStorageManager); } catch (AccountsException e) { - Log_OC.e(TAG, "Error while trying to get autorization", e); + Log_OC.e(TAG, "Error while trying to get authorization", e); } catch (IOException e) { - Log_OC.e(TAG, "Error while trying to get autorization", e); + Log_OC.e(TAG, "Error while trying to get authorization", e); } finally { + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Removing payload " + remotePath); + mPendingOperations.removePayload(account, remotePath); mService.dispatchResultToOperationListeners(null, mCurrentSyncOperation, result); @@ -148,17 +157,26 @@ class SyncFolderHandler extends Handler { Log_OC.e(TAG, "Cannot cancel with NULL parameters"); return; } + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Removing sync folder " + file.getRemotePath()); Pair removeResult = mPendingOperations.remove(account, file.getRemotePath()); SynchronizeFolderOperation synchronization = removeResult.first; if (synchronization != null) { + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Canceling returned sync of " + file.getRemotePath()); synchronization.cancel(); } else { - // TODO synchronize + // TODO synchronize? if (mCurrentSyncOperation != null && mCurrentAccount != null && - mCurrentSyncOperation.getFolderPath().startsWith(file.getRemotePath()) && + mCurrentSyncOperation.getRemotePath().startsWith(file.getRemotePath()) && account.name.equals(mCurrentAccount.name)) { + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Canceling current sync as descendant: " + mCurrentSyncOperation.getRemotePath()); mCurrentSyncOperation.cancel(); + } else { + Log_OC.v( "NOW " + TAG + ", thread " + Thread.currentThread().getName(), + "Nothing else in cancelation of " + file.getRemotePath()); } }