summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-09-05 14:09:17 -0700
committerJeff Sharkey <jsharkey@android.com>2013-09-05 14:09:17 -0700
commite4b402b205fd958f28ffcf32262f485d2a78e3d0 (patch)
tree7311f9509513a0b0ee444264fda6428bf05b70f7
parent5669bb20b45b14670f9b6844e1ddaa428058cdb1 (diff)
downloadandroid_packages_providers_DownloadProvider-e4b402b205fd958f28ffcf32262f485d2a78e3d0.zip
android_packages_providers_DownloadProvider-e4b402b205fd958f28ffcf32262f485d2a78e3d0.tar.gz
android_packages_providers_DownloadProvider-e4b402b205fd958f28ffcf32262f485d2a78e3d0.tar.bz2
Relay content change notifications to documents.
Bug: 10531347 Change-Id: Ia704b233623e913da3a5cb7c8aa5e024900e1d3a
-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);
}