summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-09-05 21:19:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-05 21:19:43 +0000
commitdd00499d5806ab043e6c882641433a21a9406b6a (patch)
tree596a94da418f618175dfbcda459cf78b6980a4d7
parentec96960f2ce6d2aa79bbdc9895909ff11c3bc2b5 (diff)
parente4b402b205fd958f28ffcf32262f485d2a78e3d0 (diff)
downloadandroid_packages_providers_DownloadProvider-dd00499d5806ab043e6c882641433a21a9406b6a.zip
android_packages_providers_DownloadProvider-dd00499d5806ab043e6c882641433a21a9406b6a.tar.gz
android_packages_providers_DownloadProvider-dd00499d5806ab043e6c882641433a21a9406b6a.tar.bz2
Merge "Relay content change notifications to documents." into klp-dev
-rw-r--r--src/com/android/providers/downloads/DownloadStorageProvider.java7
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 87c9f5b..04cbf09 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);
}