浏览代码

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

David A. Velasco 9 年之前
父节点
当前提交
52d8b7c264
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/com/owncloud/android/files/services/FileUploader.java

+ 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(),
         mNotificationBuilder.setContentIntent(PendingIntent.getActivity(this, (int) System.currentTimeMillis(),
             showUploadListIntent, 0));
             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
 
 
     }
     }