mirror of
https://github.com/nextcloud/android.git
synced 2024-12-19 15:33:00 +03:00
wip
This commit is contained in:
parent
25410ff36a
commit
8b3ed70791
3 changed files with 19 additions and 3 deletions
|
@ -195,10 +195,13 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
|
|||
&& (!instantPictureUploadViaWiFiOnly(context) || (instantPictureUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))) {
|
||||
DbHandler db = new DbHandler(context);
|
||||
Cursor c = db.getAwaitingFiles();
|
||||
if (c.moveToFirst() && isOnline(context)
|
||||
&& (!instantPictureUploadViaWiFiOnly(context) ||
|
||||
(instantPictureUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))) {
|
||||
if (c.moveToFirst()) {
|
||||
do {
|
||||
if (instantPictureUploadViaWiFiOnly(context) &&
|
||||
!isConnectedViaWiFi(context)){
|
||||
break;
|
||||
}
|
||||
|
||||
String account_name = c.getString(c.getColumnIndex("account"));
|
||||
String file_path = c.getString(c.getColumnIndex("path"));
|
||||
File f = new File(file_path);
|
||||
|
|
|
@ -213,6 +213,16 @@ public class FileUploader extends Service
|
|||
|
||||
if (intent.hasExtra(KEY_CANCEL_ALL) && intent.hasExtra(KEY_ACCOUNT)){
|
||||
Account account = intent.getParcelableExtra(KEY_ACCOUNT);
|
||||
|
||||
Log_OC.d(TAG, "Account= " + account.name);
|
||||
|
||||
if (mCurrentUpload != null) {
|
||||
Log_OC.d(TAG, "Current Upload Account= " + mCurrentUpload.getAccount().name);
|
||||
if (mCurrentUpload.getAccount().name.equals(account.name)) {
|
||||
mCurrentUpload.cancel();
|
||||
}
|
||||
}
|
||||
// Cancel pending uploads
|
||||
cancelUploadForAccount(account.name);
|
||||
}
|
||||
|
||||
|
|
|
@ -372,6 +372,9 @@ public class UploadFileOperation extends RemoteOperation {
|
|||
if (temporalFile != null && !originalFile.equals(temporalFile)) {
|
||||
temporalFile.delete();
|
||||
}
|
||||
if (result == null){
|
||||
return new RemoteOperationResult(false, 404, null);
|
||||
}
|
||||
if (result.isSuccess()) {
|
||||
Log_OC.i(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath + ": " +
|
||||
result.getLogMessage());
|
||||
|
|
Loading…
Reference in a new issue