Closed Bug 1114506 Opened 8 years ago Closed 8 years ago

Downloads are not cleared after clearing private data


(Firefox for Android Graveyard :: Download Manager, defect)

Not set


(firefox34 unaffected, firefox35 unaffected, firefox36 unaffected, firefox37+ verified, fennec37+)

Firefox 37
Tracking Status
firefox34 --- unaffected
firefox35 --- unaffected
firefox36 --- unaffected
firefox37 + verified
fennec 37+ ---


(Reporter: CristinaM, Assigned: Margaret)



(Keywords: regression, reproducible)


(1 file, 1 obsolete file)

Device: Asus Transformer TF101 (Android 4.0.3);
Build: Nightly 37.0a1 (2014-12-21);

Steps to reproduce:
1. Download a file (e.g.:;
2. Go to Settings -> Privacy -> Clear now;
3. Make sure that all the options are checked and tap on 'Clear data' button;
4. Go to Tools - > Downloads.

Expected result:
The downloads list is empty.

Actual result:
The downloaded file is present in the downloads list.

Regression window:
Last good: 2014-12-16
First bad: 2014-12-17


Probably Bug 901360 caused the regression.
[Tracking Requested - why for this release]: Regressions from bug 901360

I was just looking into some remaining nsIDownloadManager uses in the "mobile/android" folder, and I expected this regression from code inspection:

On Desktop, this now uses DownloadList.removeFinished:

It seems on Android you want to remove files on disk though, so you might need your own implementation. It would require just a few lines, you can look at the current removeFinished implementation for reference:
Depends on: 901360
Is this actually a regression? Bug 1107510 seems to indicate that this was an existing issue.
Bug 1107510 was reproducible only in private browsing. 
This issue is reproducible starting from 2014-12-17, I am not able to reproduce it on previous builds, so I guess is a regression.
I can look into this.
Assignee: nobody → margaret.leibovic
tracking-fennec: --- → ?
Blocks: 901360
No longer depends on: 901360
Looks like Sanitizer.jsm still uses the old downloads API:
Attachment #8540335 - Flags: review?(paolo.mozmail)
Attachment #8540335 - Flags: review?(mark.finkle)
/r/1649 - Bug 1114506 - Update Sanitizer.jsm to use Downloads.jsm to clear downloads

Pull down this commit:

hg pull review -r 622e088926a9e57c78bbd81563fc370fe127785d
Attachment #8540335 - Flags: review?(mark.finkle) → review+

::: mobile/android/modules/Sanitizer.jsm
(Diff revision 1)
> +            // Delete the downloaded files themselves.
> +            let file = new FileUtils.File(;
> +            if (file.exists()) {
> +              file.remove(false);
>              }

You should use OS.File.remove in new code. For efficiency, we recommend just invoking remove and catching exceptions, rather than checking for existence first. I'd also report real errors but continue with the next download, something similar to this:

(You might not need the becauseAccessDenied check and may want to report those errors as well.)
Attachment #8540335 - Flags: review?(paolo.mozmail)
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Verified as fixed on latest Nightly on Nexus 7(Android 5.0.1)
Blocks: 1107510
tracking-fennec: ? → 37+
Attachment #8540335 - Attachment is obsolete: true
Attachment #8618945 - Flags: review+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.