summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Kwa <kenobi@google.com>2016-01-09 01:05:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-01-09 01:05:06 +0000
commit27f864b413e213ccff30e7a3b9aa7b56266e2536 (patch)
tree737db9ca457fef8a6026ff376b6cd441660a9e99
parent307b464de52444531365a55eb700da6ba2b28ad2 (diff)
parent66cfb5c7a836bbb043ce60480c3626faae42b89c (diff)
downloadandroid_packages_providers_DownloadProvider-27f864b413e213ccff30e7a3b9aa7b56266e2536.zip
android_packages_providers_DownloadProvider-27f864b413e213ccff30e7a3b9aa7b56266e2536.tar.gz
android_packages_providers_DownloadProvider-27f864b413e213ccff30e7a3b9aa7b56266e2536.tar.bz2
Merge "Assign a null timestamp to active downloads."
-rw-r--r--src/com/android/providers/downloads/DownloadStorageProvider.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java
index a36f0d8..77b8fe4 100644
--- a/src/com/android/providers/downloads/DownloadStorageProvider.java
+++ b/src/com/android/providers/downloads/DownloadStorageProvider.java
@@ -373,8 +373,12 @@ public class DownloadStorageProvider extends DocumentsProvider {
row.add(Document.COLUMN_SUMMARY, summary);
row.add(Document.COLUMN_SIZE, size);
row.add(Document.COLUMN_MIME_TYPE, mimeType);
- row.add(Document.COLUMN_LAST_MODIFIED, lastModified);
row.add(Document.COLUMN_FLAGS, flags);
+ // Incomplete downloads get a null timestamp. This prevents thrashy UI when a bunch of
+ // active downloads get sorted by mod time.
+ if (status != DownloadManager.STATUS_RUNNING) {
+ row.add(Document.COLUMN_LAST_MODIFIED, lastModified);
+ }
final String localFilePath = cursor.getString(
cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_LOCAL_FILENAME));