summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2018-07-09 18:16:26 (GMT)
committerMSe1969 <mse1969@posteo.de>2018-09-13 09:30:30 (GMT)
commit620f9e6c84434c0950a2cbc1a6e73e843c93bdd6 (patch)
treebf01bc20a91376ab06b898cec526b568845ed88c
parent32e542594c7dcdab5df96ff2edcf90f083d57ef4 (diff)
downloadandroid_packages_providers_DownloadProvider-cm-11.0.zip
android_packages_providers_DownloadProvider-cm-11.0.tar.gz
android_packages_providers_DownloadProvider-cm-11.0.tar.bz2
Remove "public" download feature.cm-11.0
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) CVE-2018-9468
-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 5995a08..d2fca9b 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 */
@@ -486,8 +478,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();
@@ -1134,8 +1125,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)