summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2018-07-09 12:16:26 -0600
committerTim Schumacher <timschumi@gmx.de>2018-10-08 18:53:35 +0200
commita137d3acc33bb1188cd92eb449b72bc1153b8bce (patch)
treed46fdbee2b0a9ba8f906efacc006fa30820367a5
parent120fc264426ee37fa17f280e299dd7767b699ec0 (diff)
downloadandroid_packages_providers_DownloadProvider-a137d3acc33bb1188cd92eb449b72bc1153b8bce.zip
android_packages_providers_DownloadProvider-a137d3acc33bb1188cd92eb449b72bc1153b8bce.tar.gz
android_packages_providers_DownloadProvider-a137d3acc33bb1188cd92eb449b72bc1153b8bce.tar.bz2
Remove "public" download feature.
It was never a supported API, and has been reported as causing security issues, so remove it. Bug: 111084083 Test: builds Change-Id: I26345b192ffd55216bb8c8fdb82cb5869d68d3db (cherry picked from commit 35e123117be9ec5d61dbaea60f6eac06c0e80dc4)
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 75a4fa2..e35b385 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -94,11 +94,6 @@ public final class DownloadProvider extends ContentProvider {
private static final int ALL_DOWNLOADS_ID = 4;
/** URI matcher constant for the URI of a download's request headers */
private static final int REQUEST_HEADERS_URI = 5;
- /** URI matcher constant for the public URI returned by
- * {@link DownloadManager#getUriForDownloadedFile(long)} if the given downloaded file
- * is publicly accessible.
- */
- private static final int PUBLIC_DOWNLOAD_ID = 6;
static {
sURIMatcher.addURI("downloads", "my_downloads", MY_DOWNLOADS);
sURIMatcher.addURI("downloads", "my_downloads/#", MY_DOWNLOADS_ID);
@@ -116,9 +111,6 @@ public final class DownloadProvider extends ContentProvider {
sURIMatcher.addURI("downloads",
"download/#/" + Downloads.Impl.RequestHeaders.URI_SEGMENT,
REQUEST_HEADERS_URI);
- sURIMatcher.addURI("downloads",
- Downloads.Impl.PUBLICLY_ACCESSIBLE_DOWNLOADS_URI_SEGMENT + "/#",
- PUBLIC_DOWNLOAD_ID);
}
/** Different base URIs that could be used to access an individual download */
@@ -520,8 +512,7 @@ public final class DownloadProvider extends ContentProvider {
return DOWNLOAD_LIST_TYPE;
}
case MY_DOWNLOADS_ID:
- case ALL_DOWNLOADS_ID:
- case PUBLIC_DOWNLOAD_ID: {
+ case ALL_DOWNLOADS_ID: {
// return the mimetype of this id from the database
final String id = getDownloadIdFromUri(uri);
final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
@@ -1207,8 +1198,7 @@ public final class DownloadProvider extends ContentProvider {
int uriMatch) {
SqlSelection selection = new SqlSelection();
selection.appendClause(where, whereArgs);
- if (uriMatch == MY_DOWNLOADS_ID || uriMatch == ALL_DOWNLOADS_ID ||
- uriMatch == PUBLIC_DOWNLOAD_ID) {
+ if (uriMatch == MY_DOWNLOADS_ID || uriMatch == ALL_DOWNLOADS_ID) {
selection.appendClause(Downloads.Impl._ID + " = ?", getDownloadIdFromUri(uri));
}
if ((uriMatch == MY_DOWNLOADS || uriMatch == MY_DOWNLOADS_ID)