summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2016-09-16 12:04:05 -0600
committerAdam Seaton <aseaton@google.com>2016-10-12 20:44:47 +0000
commit5756cb0fb74fe13f4f8bf594de4bca8f866495a0 (patch)
tree473963e2d866de438bfbb2db691243b74598191f
parent0a857ee2caae15f2cfd7afc2986741146821ed10 (diff)
downloadbase-5756cb0fb74fe13f4f8bf594de4bca8f866495a0.tar.gz
Use "all_downloads" instead of "my_downloads".
Fix Merge Conflict into nyc-release We can no longer return the "my_downloads" paths: if those Uris were shared beyond the app that requested the download, access would be denied. Instead, we need to switch to using "all_downloads" Uris so that permission grants can be issued to third-party viewer apps. Since an app requesting a download doesn't normally have permission to "all_downloads" paths, DownloadProvider now issues narrow grants toward the owner of each download, both at device boot and when new downloads are started. Bug: 30537115, 30945409 Change-Id: I533125b36444877f54373d88922f2acc777e250b (cherry picked from commit 9fab683c9598d234dd8461335c276ed3e37c91e8)
-rw-r--r--core/java/android/app/DownloadManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java
index eb07fbc5271a..66234da72c5d 100644
--- a/core/java/android/app/DownloadManager.java
+++ b/core/java/android/app/DownloadManager.java
@@ -1089,7 +1089,7 @@ public class DownloadManager {
if (cursor.moveToFirst()) {
int status = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_STATUS));
if (DownloadManager.STATUS_SUCCESSFUL == status) {
- return ContentUris.withAppendedId(Downloads.Impl.CONTENT_URI, id);
+ return ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, id);
}
}
} finally {
@@ -1425,7 +1425,7 @@ public class DownloadManager {
* @hide
*/
public Uri getDownloadUri(long id) {
- return ContentUris.withAppendedId(mBaseUri, id);
+ return ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, id);
}
/**
@@ -1519,7 +1519,7 @@ public class DownloadManager {
// return content URI for cache download
long downloadId = getLong(getColumnIndex(Downloads.Impl._ID));
- return ContentUris.withAppendedId(mBaseUri, downloadId).toString();
+ return ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, downloadId).toString();
}
private long getReason(int status) {