mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
Restart uploads after app restart
Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
parent
5ba3201bc5
commit
878052991c
2 changed files with 9 additions and 3 deletions
|
@ -148,7 +148,11 @@ class FileUploadWorker(
|
|||
uploadsStorageManager.getCurrentAndPendingUploadsForAccountPageAscById(lastId, accountName)
|
||||
}
|
||||
|
||||
if(isStopped){
|
||||
Log_OC.d(TAG, "FileUploadWorker for account $accountName was stopped")
|
||||
}else{
|
||||
Log_OC.d(TAG, "No more pending uploads for account $accountName, stopping work")
|
||||
}
|
||||
return Result.success()
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,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.lib.common.utils.Log_OC;
|
||||
|
||||
import org.lukhnos.nnio.file.FileVisitResult;
|
||||
|
@ -173,13 +174,14 @@ public final class FilesSyncHelper {
|
|||
final UserAccountManager accountManager,
|
||||
final ConnectivityService connectivityService,
|
||||
final PowerManagementService powerManagementService) {
|
||||
final Context context = MainApp.getAppContext();
|
||||
|
||||
boolean accountExists;
|
||||
|
||||
boolean whileChargingOnly = true;
|
||||
boolean useWifiOnly = true;
|
||||
|
||||
// Make all in progress downloads failed to restart upload worker
|
||||
uploadsStorageManager.failInProgressUploads(UploadResult.SERVICE_INTERRUPTED);
|
||||
|
||||
OCUpload[] failedUploads = uploadsStorageManager.getFailedUploads();
|
||||
|
||||
for (OCUpload failedUpload : failedUploads) {
|
||||
|
|
Loading…
Reference in a new issue