Closed Bug 632170 Opened 13 years ago Closed 13 years ago

Downloaded files should be saved in a public place

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(fennec2.0b5+)

VERIFIED FIXED
Tracking Status
fennec 2.0b5+ ---

People

(Reporter: wesj, Assigned: wesj)

Details

(Keywords: regression)

Attachments

(2 files, 2 obsolete files)

Bug 622684 changed the method used for finding the downloads directory to use new APIs available in SDK 8 and greater. We're now calling getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS) which returns something like:

/Android/data/<package_name>/files/Download

instead we can use the public downloads directory, recommended for "shared" files by http://developer.android.com/guide/topics/data/data-storage.html#filesExternal by using:

getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)

which may even make things like images show up in the gallery again?.
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #510384 - Flags: review?(blassey.bugs)
is it possible to continue to download our updates to the private location?
Yeah. We'd probably need a separate environmental variable, and then an update to mobile browser at:

http://mxr.mozilla.org/mobile-browser/source/components/DirectoryProvider.js#77
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0b5+
Assignee: nobody → wjohnston
Attached patch Patch v2Splinter Review
Attachment #510384 - Attachment is obsolete: true
Attachment #510708 - Flags: review?(blassey.bugs)
Attachment #510384 - Flags: review?(blassey.bugs)
Attached patch Mobile-browser v1 (obsolete) — Splinter Review
Comment on attachment 510708 [details] [diff] [review]
Patch v2

Removing review request till I've had a chance to test these. Sorry :(
Attachment #510708 - Flags: review?(blassey.bugs)
Returns the directory given by the environmental variable "UPDATES_DIRECTORY" if it exists, otherwise uses the downloads directory.

Note, updates are actually stored in this path + "/updates/".
Attachment #510710 - Attachment is obsolete: true
Attachment #510838 - Flags: review?(mark.finkle)
Comment on attachment 510708 [details] [diff] [review]
Patch v2

These return the correct directory for me on desktop and device. Not sure how you test actual updates...
Attachment #510708 - Flags: review?(blassey.bugs)
Keywords: regression
Comment on attachment 510838 [details] [diff] [review]
Mobile-browser v1.1

Do we care if the localFile exists or not? We could check that too.

r+, but think about the check - we might not need it if we are being given the value in Java.
Attachment #510838 - Flags: review?(mark.finkle) → review+
Attachment #510708 - Flags: review?(blassey.bugs) → review+
pushed:
mc: http://hg.mozilla.org/mozilla-central/rev/8728536ebec3
mb: http://hg.mozilla.org/mobile-browser/rev/da356a8d0644
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
VERIFIED FIXED on:
Build Id:
Mozilla /5.0 (Android;Linux armv7l;rv:2.0b12pre) Gecko/20110210
Firefox/4.0b12pre Fennec /4.0b5pre 

Device: Motorola Droid 2 (Android 2.2)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: