Bug 1310491 - Part 1 - Always properly clear speculative downloads when forwarding a download. r?esawin
If we have to forward a download that we cannot handle ourselves to the Android
download manager, then the speculative download started by Firefox needs to be
aborted no matter whether forwarding succeeded or not.
MozReview-Commit-ID: B6zCk28ci1P
--- a/mobile/android/components/HelperAppDialog.js
+++ b/mobile/android/components/HelperAppDialog.js
@@ -138,19 +138,19 @@ HelperAppLauncherDialog.prototype = {
}
if (this._shouldForwardToAndroidDownloadManager(aLauncher)) {
Task.spawn(function* () {
try {
let hasPermission = yield RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE);
if (hasPermission) {
this._downloadWithAndroidDownloadManager(aLauncher);
- aLauncher.cancel(Cr.NS_BINDING_ABORTED);
}
} finally {
+ aLauncher.cancel(Cr.NS_BINDING_ABORTED);
}
}.bind(this)).catch(Cu.reportError);
return;
}
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
let defaultHandler = new Object();