diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-09-05 14:23:53 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-05 14:23:53 -0700 |
commit | 756426788d32821e265e021142eae9dabbdeaa78 (patch) | |
tree | 77722f1d30fe62becac5a2e19f594b26c7e22968 | |
parent | 8bbc35713d730ce64d78c40b775826a174c3f4c9 (diff) | |
parent | dd00499d5806ab043e6c882641433a21a9406b6a (diff) | |
download | android_packages_providers_DownloadProvider-756426788d32821e265e021142eae9dabbdeaa78.tar.gz android_packages_providers_DownloadProvider-756426788d32821e265e021142eae9dabbdeaa78.tar.bz2 android_packages_providers_DownloadProvider-756426788d32821e265e021142eae9dabbdeaa78.zip |
am dd00499d: Merge "Relay content change notifications to documents." into klp-dev
* commit 'dd00499d5806ab043e6c882641433a21a9406b6a':
Relay content change notifications to documents.
-rw-r--r-- | src/com/android/providers/downloads/DownloadStorageProvider.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java index 87c9f5b0..04cbf090 100644 --- a/src/com/android/providers/downloads/DownloadStorageProvider.java +++ b/src/com/android/providers/downloads/DownloadStorageProvider.java @@ -74,6 +74,10 @@ public class DownloadStorageProvider extends DocumentsProvider { return projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION; } + private void copyNotificationUri(MatrixCursor result, Cursor cursor) { + result.setNotificationUri(getContext().getContentResolver(), cursor.getNotificationUri()); + } + @Override public Cursor queryRoots(String[] projection) throws FileNotFoundException { final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); @@ -112,6 +116,7 @@ public class DownloadStorageProvider extends DocumentsProvider { Cursor cursor = null; try { cursor = mDm.query(new Query().setFilterById(Long.parseLong(docId))); + copyNotificationUri(result, cursor); if (cursor.moveToFirst()) { includeDownloadFromCursor(result, cursor); } @@ -133,6 +138,7 @@ public class DownloadStorageProvider extends DocumentsProvider { Cursor cursor = null; try { cursor = mDm.query(mBaseQuery); + copyNotificationUri(result, cursor); while (cursor.moveToNext()) { includeDownloadFromCursor(result, cursor); } @@ -154,6 +160,7 @@ public class DownloadStorageProvider extends DocumentsProvider { try { cursor = mDm.query(new DownloadManager.Query().setOnlyIncludeVisibleInDownloadsUi(true) .setFilterByStatus(DownloadManager.STATUS_SUCCESSFUL)); + copyNotificationUri(result, cursor); while (cursor.moveToNext() && result.getCount() < 12) { includeDownloadFromCursor(result, cursor); } |