summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/DownloadHandler.java4
-rw-r--r--src/com/android/browser/FetchUrlMimeType.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java
index cbf26f40f..40278f480 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 2538d90ad..85c588eb0 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