Эх сурвалжийг харах

Prevent that upload-in-progress notification is shown for instant uploads unless they are really performed

David A. Velasco 9 жил өмнө
parent
commit
52d8b7c264

+ 5 - 1
src/com/owncloud/android/files/services/FileUploader.java

@@ -978,7 +978,11 @@ public class FileUploader extends Service
         mNotificationBuilder.setContentIntent(PendingIntent.getActivity(this, (int) System.currentTimeMillis(),
             showUploadListIntent, 0));
 
-        mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotificationBuilder.build());
+        if (!upload.isInstantPicture() && !upload.isInstantVideo()) {
+            mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotificationBuilder.build());
+        }   // else wait until the upload really start (onTransferProgress is called), so that if it's discarded
+        // due to lack of Wifi, no notification is shown
+        // TODO generalize for automated uploads
 
     }