summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-09-05 14:26:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-05 14:26:24 -0700
commitf075f3247922598f9787a119e4547a313c629b63 (patch)
tree2744bbe592c4aab4cd4a29a7664d947255c71dd7
parent51f33d848d33f91777b91bc7ef5ec94dcdb2ce8f (diff)
parent756426788d32821e265e021142eae9dabbdeaa78 (diff)
downloadandroid_packages_providers_DownloadProvider-f075f3247922598f9787a119e4547a313c629b63.tar.gz
android_packages_providers_DownloadProvider-f075f3247922598f9787a119e4547a313c629b63.tar.bz2
android_packages_providers_DownloadProvider-f075f3247922598f9787a119e4547a313c629b63.zip
am 75642678: am dd00499d: Merge "Relay content change notifications to documents." into klp-dev
* commit '756426788d32821e265e021142eae9dabbdeaa78': Relay content change notifications to documents.
-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 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);
}