Try to cancel transfers when an account is deleted outside of the app: Done
[pub/Android/ownCloud.git] / src / com / owncloud / android / files / services / FileUploader.java
index b076d6f..3ce1aac 100644 (file)
@@ -459,6 +459,16 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
             }
         }
 
+        /**
+         * Review uploads and cancel it if its account doesn't exist
+         */
+        public void reviewUploads() {
+            if (mCurrentUpload != null &&
+                    !AccountUtils.exists(mCurrentUpload.getAccount(), getApplicationContext())) {
+                mCurrentUpload.cancel();
+            }
+            // The rest of uploads are cancelled when they try to start
+        }
     }
 
     /**