diff options
author | Vasu Nori <vnori@google.com> | 2010-12-18 20:15:46 -0800 |
---|---|---|
committer | Vasu Nori <vnori@google.com> | 2010-12-19 02:06:04 -0800 |
commit | c2df8342039829c868b30ad3bc3f865e26a04b1c (patch) | |
tree | e4ef73a26fb689d3132144fb7f85354e1cdbb3ab /src | |
parent | 9b898f43be19f9367263c78297e03e3af3748069 (diff) | |
download | packages_apps_browser-c2df8342039829c868b30ad3bc3f865e26a04b1c.zip packages_apps_browser-c2df8342039829c868b30ad3bc3f865e26a04b1c.tar.gz packages_apps_browser-c2df8342039829c868b30ad3bc3f865e26a04b1c.tar.bz2 |
bug:3297328 set download destination dir to /sdcard/Download
downlaoded files should go into /sdcard/Download, like they used to
in GB and earlier.
But a minor difference in the download dir name:
it used to be /sdcard/download in before HC
/sdcard/Download in HC
how serious is this difference?
Change-Id: Ib56d8ee6a1393fd781399281be98b8c52831ebe1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/DownloadHandler.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/FetchUrlMimeType.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java index cbf26f4..40278f4 100644 --- a/src/com/android/browser/DownloadHandler.java +++ b/src/com/android/browser/DownloadHandler.java @@ -183,7 +183,9 @@ public class DownloadHandler { Uri uri = Uri.parse(addressString); final DownloadManager.Request request = new DownloadManager.Request(uri); request.setMimeType(mimetype); - request.setDestinationInExternalFilesDir(activity, null, filename); + // set downloaded file destination to /sdcard/Download. + // or, should it be set to one of several Environment.DIRECTORY* dirs depending on mimetype? + request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename); // let this downloaded file be scanned by MediaScanner - so that it can // show up in Gallery app, for example. request.allowScanningByMediaScanner(); diff --git a/src/com/android/browser/FetchUrlMimeType.java b/src/com/android/browser/FetchUrlMimeType.java index 2538d90..85c588e 100644 --- a/src/com/android/browser/FetchUrlMimeType.java +++ b/src/com/android/browser/FetchUrlMimeType.java @@ -27,6 +27,7 @@ import android.app.DownloadManager; import android.content.Context; import android.net.Proxy; import android.net.http.AndroidHttpClient; +import android.os.Environment; import android.webkit.MimeTypeMap; import android.webkit.URLUtil; @@ -116,7 +117,7 @@ class FetchUrlMimeType extends Thread { } String filename = URLUtil.guessFileName(mUri, contentDisposition, mimeType); - mRequest.setDestinationInExternalFilesDir(mActivity, null, filename); + mRequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename); } // Start the download |