mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 05:35:39 +03:00
Some progress on auto-upload fixes
This commit is contained in:
parent
dcf99f8cb4
commit
9c39a6dfdc
2 changed files with 11 additions and 0 deletions
|
@ -128,6 +128,7 @@ public class FileAlterationMagicListener implements FileAlterationListener {
|
|||
if (fileRunnable.containsKey(file.getAbsolutePath())) {
|
||||
handler.removeCallbacks(fileRunnable.get(file.getAbsolutePath()));
|
||||
handler.postDelayed(fileRunnable.get(file.getAbsolutePath()), 500);
|
||||
fileRunnable.remove(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,6 +136,7 @@ public class FileAlterationMagicListener implements FileAlterationListener {
|
|||
public void onFileDelete(File file) {
|
||||
if (fileRunnable.containsKey(file.getAbsolutePath())) {
|
||||
handler.removeCallbacks(fileRunnable.get(file.getAbsolutePath()));
|
||||
fileRunnable.remove(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,15 @@ public class SyncedFolderObserverService extends Service {
|
|||
} else {
|
||||
for(int i = 0; i < pairArrayList.size(); i++) {
|
||||
SyncedFolder syncFolder = pairArrayList.get(i).getKey();
|
||||
for(SyncedFolder syncedFolder : mProvider.getSyncedFolders()) {
|
||||
if (syncFolder.getId() == syncedFolder.getId()) {
|
||||
syncFolder = syncedFolder;
|
||||
pairArrayList.set(i, new SerializablePair<SyncedFolder, FileEntry>(syncFolder,
|
||||
pairArrayList.get(i).getValue()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FileAlterationMagicObserver observer = new FileAlterationMagicObserver(new File(
|
||||
syncFolder.getLocalPath()), fileFilter);
|
||||
observer.setRootEntry(pairArrayList.get(i).getValue());
|
||||
|
|
Loading…
Reference in a new issue