diff options
Diffstat (limited to 'src/com/android/providers/downloads/Helpers.java')
-rw-r--r-- | src/com/android/providers/downloads/Helpers.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java index f2988954..5d546ff6 100644 --- a/src/com/android/providers/downloads/Helpers.java +++ b/src/com/android/providers/downloads/Helpers.java @@ -94,9 +94,10 @@ public class Helpers { String contentLocation, String mimeType, int destination, - long contentLength) throws FileNotFoundException { + long contentLength, + boolean isPublicApi) throws FileNotFoundException { - if (!canHandleDownload(context, mimeType, destination)) { + if (!canHandleDownload(context, mimeType, destination, isPublicApi)) { return new DownloadFileInfo(null, null, Downloads.Impl.STATUS_NOT_ACCEPTABLE); } @@ -156,7 +157,12 @@ public class Helpers { return chooseUniqueFilename(destination, filename, extension, recoveryDir); } - private static boolean canHandleDownload(Context context, String mimeType, int destination) { + private static boolean canHandleDownload(Context context, String mimeType, int destination, + boolean isPublicApi) { + if (isPublicApi) { + return true; + } + if (destination == Downloads.Impl.DESTINATION_EXTERNAL || destination == Downloads.Impl.DESTINATION_CACHE_PARTITION_PURGEABLE) { if (mimeType == null) { |