Downloaded files should be saved in a public place

VERIFIED FIXED

Status

Firefox for Android Graveyard
General
VERIFIED FIXED
7 years ago
7 years ago

People

(Reporter: wesj, Assigned: wesj)

Tracking

({regression})

Trunk
All
Android
regression

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

7 years ago
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?.
(Assignee)

Comment 1

7 years ago
Created attachment 510384 [details] [diff] [review]
Patch v1
Attachment #510384 - Flags: review?(blassey.bugs)
is it possible to continue to download our updates to the private location?
(Assignee)

Comment 3

7 years ago
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
(Assignee)

Comment 4

7 years ago
Created attachment 510708 [details] [diff] [review]
Patch v2
Attachment #510384 - Attachment is obsolete: true
Attachment #510708 - Flags: review?(blassey.bugs)
Attachment #510384 - Flags: review?(blassey.bugs)
(Assignee)

Comment 5

7 years ago
Created attachment 510710 [details] [diff] [review]
Mobile-browser v1
(Assignee)

Comment 6

7 years ago
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)
(Assignee)

Comment 7

7 years ago
Created attachment 510838 [details] [diff] [review]
Mobile-browser v1.1

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)
(Assignee)

Comment 8

7 years ago
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+
(Assignee)

Comment 10

7 years ago
pushed:
mc: http://hg.mozilla.org/mozilla-central/rev/8728536ebec3
mb: http://hg.mozilla.org/mobile-browser/rev/da356a8d0644
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED

Comment 11

7 years ago
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.