summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/Helpers.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-01-21 13:09:54 -0500
committerLeon Scroggins <scroggo@google.com>2010-01-21 14:57:08 -0500
commit0f1aae327a9e4c68044d767e9bafbac747b6d985 (patch)
treef57e0b91c9a2a21865208639f9c09978a1ead64a /src/com/android/providers/downloads/Helpers.java
parent7dd92fa94df0a13b4592ee636b7aa2b605f6b473 (diff)
downloadandroid_packages_providers_DownloadProvider-0f1aae327a9e4c68044d767e9bafbac747b6d985.tar.gz
android_packages_providers_DownloadProvider-0f1aae327a9e4c68044d767e9bafbac747b6d985.tar.bz2
android_packages_providers_DownloadProvider-0f1aae327a9e4c68044d767e9bafbac747b6d985.zip
Download files even if there is no activity to launch them.
Fixes http://b/issue?id=2367247
Diffstat (limited to 'src/com/android/providers/downloads/Helpers.java')
-rw-r--r--src/com/android/providers/downloads/Helpers.java27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java
index 774aba66..0847b78e 100644
--- a/src/com/android/providers/downloads/Helpers.java
+++ b/src/com/android/providers/downloads/Helpers.java
@@ -19,8 +19,6 @@ package com.android.providers.downloads;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.drm.mobile1.DrmRawContent;
import android.net.ConnectivityManager;
@@ -99,31 +97,6 @@ public class Helpers {
}
return new DownloadFileInfo(null, null, Downloads.Impl.STATUS_NOT_ACCEPTABLE);
}
- if (!DrmRawContent.DRM_MIMETYPE_MESSAGE_STRING.equalsIgnoreCase(mimeType)) {
- // Check to see if we are allowed to download this file. Only files
- // that can be handled by the platform can be downloaded.
- // special case DRM files, which we should always allow downloading.
- Intent intent = new Intent(Intent.ACTION_VIEW);
-
- // We can provide data as either content: or file: URIs,
- // so allow both. (I think it would be nice if we just did
- // everything as content: URIs)
- // Actually, right now the download manager's UId restrictions
- // prevent use from using content: so it's got to be file: or
- // nothing
-
- PackageManager pm = context.getPackageManager();
- intent.setDataAndType(Uri.fromParts("file", "", null), mimeType);
- ResolveInfo ri = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
- //Log.i(Constants.TAG, "*** FILENAME QUERY " + intent + ": " + list);
-
- if (ri == null) {
- if (Config.LOGD) {
- Log.d(Constants.TAG, "no handler found for type " + mimeType);
- }
- return new DownloadFileInfo(null, null, Downloads.Impl.STATUS_NOT_ACCEPTABLE);
- }
- }
}
String filename = chooseFilename(
url, hint, contentDisposition, contentLocation, destination);