Better handling of exception.
- Show an android toast when play store app is not available
on the device.
- Handle gracefully when exception occurs when enqueueing
a download.
Change-Id: Id3855394138e642b76ef89883960ee66be6c7323
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java
index f42ee76..ab24b76 100644
--- a/src/com/android/browser/DownloadHandler.java
+++ b/src/com/android/browser/DownloadHandler.java
@@ -112,7 +112,11 @@
.getSystemService(Context.DOWNLOAD_SERVICE);
new Thread("Browser download") {
public void run() {
- manager.enqueue(request);
+ try {
+ manager.enqueue(request);
+ } catch (Exception e) {
+ Log.w("DLHandler", "Could not enqueue the download", e);
+ }
}
}.start();
showStartDownloadToast(activity, privateBrowsing);