Try to workaround disappeared files bug

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-07-01 19:53:14 +02:00 committed by AndyScherzinger
parent 5087ff4537
commit 8cabe1f3d9
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -42,6 +42,7 @@ import com.owncloud.android.datamodel.SyncedFolder;
import com.owncloud.android.datamodel.SyncedFolderProvider;
import com.owncloud.android.datamodel.UploadsStorageManager;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.db.UploadResult;
import com.owncloud.android.jobs.AutoUploadJob;
import org.lukhnos.nnio.file.FileVisitResult;
@ -219,9 +220,10 @@ public class FilesSyncHelper {
UploadsStorageManager uploadsStorageManager = new UploadsStorageManager(context.getContentResolver(), context);
OCUpload[] failedUploads = uploadsStorageManager.getFailedUploads();
boolean accountExists = false;
boolean accountExists;
for (OCUpload failedUpload: failedUploads) {
accountExists = false;
if (!failedUpload.getLastResult().equals(UploadResult.UPLOADED)) {
uploadsStorageManager.removeUpload(failedUpload);
// check if accounts still exists
@ -253,3 +255,4 @@ public class FilesSyncHelper {
}
}
}
}