diff options
author | Eddie Ringle <eddie.ringle@gmail.com> | 2010-12-19 03:08:54 -0500 |
---|---|---|
committer | Eddie Ringle <eddie.ringle@gmail.com> | 2010-12-19 13:44:39 -0500 |
commit | f05a18333ff45a4089c8bf81cb9bf74467da7322 (patch) | |
tree | 7d7f38b030fcfec76c8cc0984d78c200bb3627ef | |
parent | 9a69f10556fcd7e600f862992e1e16d69b34cb48 (diff) | |
download | android_packages_providers_DownloadProvider-f05a18333ff45a4089c8bf81cb9bf74467da7322.tar.gz android_packages_providers_DownloadProvider-f05a18333ff45a4089c8bf81cb9bf74467da7322.tar.bz2 android_packages_providers_DownloadProvider-f05a18333ff45a4089c8bf81cb9bf74467da7322.zip |
Download any file type
Change-Id: Ib1712eb3c4d0335e0822be53f9c6fd7b6ac9585e
Signed-off-by: Eddie Ringle <eddie.ringle@gmail.com>
-rw-r--r-- | src/com/android/providers/downloads/Helpers.java | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java index 855cba28..06669fd7 100644 --- a/src/com/android/providers/downloads/Helpers.java +++ b/src/com/android/providers/downloads/Helpers.java @@ -173,43 +173,7 @@ public class Helpers { private static void checkCanHandleDownload(Context context, String mimeType, int destination, boolean isPublicApi) throws GenerateSaveFileError { - if (isPublicApi) { - return; - } - - if (destination == Downloads.Impl.DESTINATION_EXTERNAL - || destination == Downloads.Impl.DESTINATION_CACHE_PARTITION_PURGEABLE) { - if (mimeType == null) { - throw new GenerateSaveFileError(Downloads.Impl.STATUS_NOT_ACCEPTABLE, - "external download with no mime type not allowed"); - } - 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 (Constants.LOGV) { - Log.v(Constants.TAG, "no handler found for type " + mimeType); - } - throw new GenerateSaveFileError(Downloads.Impl.STATUS_NOT_ACCEPTABLE, - "no handler found for this download type"); - } - } - } + return; } private static File locateDestinationDirectory(Context context, String mimeType, |