Removed cancellation of all the uploads when Wifi is lost, not needed anymore after FileUploader refactoring

This commit is contained in:
David A. Velasco 2016-03-02 17:06:12 +01:00
parent 573d94453b
commit fbfb5d56b4
2 changed files with 10 additions and 12 deletions

View file

@ -20,7 +20,6 @@
package com.owncloud.android.files.services;
import android.accounts.Account;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@ -31,8 +30,6 @@ import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.db.PreferenceReader;
import com.owncloud.android.lib.common.utils.Log_OC;
/**
@ -96,6 +93,15 @@ public class ConnectivityActionReceiver extends BroadcastReceiver {
}
private void wifiDisconnected(Context context) {
// This is not needed anymore after refactoring FileUploader service;
// - if any upload is in progress, it will be interrupted due to the lack of connectivity while
// the device reconnects through
// - if other instant uploads are queued and the current settings requires 'Wifi only', FileUploader
// will not execute them, since this is now checked when the upload is starting, not when it's
// requested, see FileUploader#uploadFile(...)
//
// Leaving commented for a (short) while
/*
boolean instantPictureWiFiOnly = PreferenceReader.instantPictureUploadViaWiFiOnly(context);
boolean instantVideoWiFiOnly = PreferenceReader.instantVideoUploadViaWiFiOnly(context);
if (instantPictureWiFiOnly || instantVideoWiFiOnly) {
@ -111,6 +117,7 @@ public class ConnectivityActionReceiver extends BroadcastReceiver {
// TODO improve with extra options to cancel selected uploads: instant_pictures, instant_videos, ...
context.startService(i);
}
*/
}

View file

@ -149,8 +149,6 @@ public class FileUploader extends Service
public static final String KEY_LOCAL_BEHAVIOUR = "BEHAVIOUR";
public static final String KEY_CANCEL_ALL = "CANCEL_ALL";
public static final int LOCAL_BEHAVIOUR_COPY = 0;
public static final int LOCAL_BEHAVIOUR_MOVE = 1;
public static final int LOCAL_BEHAVIOUR_FORGET = 2;
@ -349,13 +347,6 @@ public class FileUploader extends Service
public int onStartCommand(Intent intent, int flags, int startId) {
Log_OC.d(TAG, "Starting command with id " + startId);
if (intent.hasExtra(KEY_CANCEL_ALL) && intent.hasExtra(KEY_ACCOUNT)){
Account account = intent.getParcelableExtra(KEY_ACCOUNT);
FileUploaderBinder fub = (FileUploaderBinder) mBinder;
fub.cancel(account);
return Service.START_NOT_STICKY;
}
boolean retry = intent.getBooleanExtra(KEY_RETRY, false);
AbstractList<String> requestedUploads = new Vector<String>();