Fixed repeated upload of instant pictures after connectivity recovery
authorDavid A. Velasco <dvelasco@solidgear.es>
Mon, 2 Jun 2014 12:32:33 +0000 (14:32 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Mon, 2 Jun 2014 12:32:33 +0000 (14:32 +0200)
src/com/owncloud/android/files/services/FileUploader.java

index 731522c..e9d8d1b 100644 (file)
@@ -807,9 +807,13 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
             resultBuilder.setContentText(content);
             mNotificationManager.notify(tickerId, resultBuilder.build());
             
             resultBuilder.setContentText(content);
             mNotificationManager.notify(tickerId, resultBuilder.build());
             
-            // Remove success notification
-            if (uploadResult.isSuccess()) {   
-                // Sleep 2 seconds, so show the notification before remove it
+            if (uploadResult.isSuccess()) {
+                
+                DbHandler db = new DbHandler(this.getBaseContext());
+                db.removeIUPendingFile(mCurrentUpload.getOriginalStoragePath());
+                db.close();
+
+                // remove success notification, with a delay of 2 seconds
                 NotificationDelayer.cancelWithDelay(
                         mNotificationManager, 
                         R.string.uploader_upload_succeeded_ticker, 
                 NotificationDelayer.cancelWithDelay(
                         mNotificationManager, 
                         R.string.uploader_upload_succeeded_ticker,