summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve McKay <smckay@google.com>2016-03-15 15:26:08 -0700
committerSteve McKay <smckay@google.com>2016-03-15 15:26:49 -0700
commit3f50be78b8a5d4ecc2e0622e833c5e1becbe8004 (patch)
treeb8f5b625212ea78a6410d5daca0b83da9188f336
parentfb816b315b01de0b1695ff97208e11eef0d05d90 (diff)
downloadandroid_packages_providers_DownloadProvider-3f50be78b8a5d4ecc2e0622e833c5e1becbe8004.zip
android_packages_providers_DownloadProvider-3f50be78b8a5d4ecc2e0622e833c5e1becbe8004.tar.gz
android_packages_providers_DownloadProvider-3f50be78b8a5d4ecc2e0622e833c5e1becbe8004.tar.bz2
Mark incomplete downloads as partial.
Bug: 27526321 Change-Id: Ic29bc235242a8b87ab8321ee201cb7918594366f
-rw-r--r--src/com/android/providers/downloads/DownloadStorageProvider.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java
index cc04d4d..bb78215 100644
--- a/src/com/android/providers/downloads/DownloadStorageProvider.java
+++ b/src/com/android/providers/downloads/DownloadStorageProvider.java
@@ -326,10 +326,12 @@ public class DownloadStorageProvider extends DocumentsProvider {
size = null;
}
+ int extraFlags = Document.FLAG_PARTIAL;
final int status = cursor.getInt(
cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS));
switch (status) {
case DownloadManager.STATUS_SUCCESSFUL:
+ extraFlags = 0; // only successful is non-partial
break;
case DownloadManager.STATUS_PAUSED:
summary = getContext().getString(R.string.download_queued);
@@ -354,7 +356,7 @@ public class DownloadStorageProvider extends DocumentsProvider {
break;
}
- int flags = Document.FLAG_SUPPORTS_DELETE | Document.FLAG_SUPPORTS_WRITE;
+ int flags = Document.FLAG_SUPPORTS_DELETE | Document.FLAG_SUPPORTS_WRITE | extraFlags;
if (mimeType.startsWith("image/")) {
flags |= Document.FLAG_SUPPORTS_THUMBNAIL;
}