From: David A. Velasco Date: Tue, 13 Nov 2012 15:01:13 +0000 (+0100) Subject: Studying lack of upload when a file that was not previously down is set as favourite... X-Git-Tag: oc-android-1.4.3~107 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/b12ca42b45b69cee9e15de0abe5758f3d75f527e?ds=inline Studying lack of upload when a file that was not previously down is set as favourite, then immediately opened and modified [WIP] --- diff --git a/src/com/owncloud/android/files/OwnCloudFileObserver.java b/src/com/owncloud/android/files/OwnCloudFileObserver.java index 8572124a..0093e7cf 100644 --- a/src/com/owncloud/android/files/OwnCloudFileObserver.java +++ b/src/com/owncloud/android/files/OwnCloudFileObserver.java @@ -18,6 +18,7 @@ package com.owncloud.android.files; +import java.io.File; import java.util.LinkedList; import java.util.List; @@ -91,9 +92,9 @@ public class OwnCloudFileObserver extends FileObserver { @Override public void onEvent(int event, String path) { - Log.d(TAG, "Got file modified with event " + event + " and path " + path); + Log.d(TAG, "Got file modified with event " + event + " and path " + mPath + ((path != null) ? File.separator + path : "")); if ((event & mMask) == 0) { - Log.wtf(TAG, "Incorrect event " + event + " sent for file " + path + + Log.wtf(TAG, "Incorrect event " + event + " sent for file " + mPath + ((path != null) ? File.separator + path : "") + " with registered for " + mMask + " and original path " + mPath); for (FileObserverStatusListener l : mListeners) diff --git a/src/com/owncloud/android/files/services/FileObserverService.java b/src/com/owncloud/android/files/services/FileObserverService.java index 41e4e52b..44713d11 100644 --- a/src/com/owncloud/android/files/services/FileObserverService.java +++ b/src/com/owncloud/android/files/services/FileObserverService.java @@ -168,7 +168,7 @@ public class FileObserverService extends Service implements FileObserverStatusLi FileDataStorageManager storage = new FileDataStorageManager(account, getContentResolver()); observer.setStorageManager(storage); - observer.setOCFile(storage.getFileByLocalPath(path)); + observer.setOCFile(storage.getFileByLocalPath(path)); // ISSUE 10 - the fix in FileDetailsFragment to avoid path == null was not enough; it the file was never down before, this sets a NULL OCFile in the observer observer.addObserverStatusListener(this); DownloadCompletedReceiver receiver = new DownloadCompletedReceiver(path, observer);