Closed Bug 874213 Opened 11 years ago Closed 11 years ago

DeviceStorage: Add a .default attribute to the device storage object.

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24
blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: dhylands, Assigned: dhylands)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [landed-in-birch])

Attachments

(1 file)

As per our conversation on the Dev-B2G list, this bug is to add a .default attribute to the device storage object.

This would reflect which device storage object would be chosen as the default object when new files are saved using the composite device storage object.

The attribute only makes sense on real device storage abjects, and only one real device storage object (within a type) can have the attribute at a time.

I'd further propose that setting the attribute to true should change the indicated storage object to be the default one (which is now done through the settings app).

I'd also propose that trying to read or write this attribue on the composite object should throw an error (from the JS perspective). Querying the attribute on any non-composite device storage object would return true or false.
I'm nominating for leo+ since the leo devices are the first devices to have multiple storage areas, and they're the ones which would benefit from having this attribute available.

Adding the .default attribute is essentially trivial.
blocking-b2g: --- → leo?
I think this is needed in order to enable 3rd party apps to build good UIs when it comes to allowing the user to choose where a given picture or other file should be saved. I.e. if it should be saved in internal storage or on the sdcard.
In support of a new v1.1 device, and Dave/Jonas' recommendations, we'll block.
Assignee: nobody → dhylands
blocking-b2g: leo? → leo+
Comment on attachment 757408 [details] [diff] [review]
Add .default attribute to the device storage object

A small patch that needs review (hopefully by tomorow)
Attachment #757408 - Flags: review?(Jan.Varga)
Comment on attachment 757408 [details] [diff] [review]
Add .default attribute to the device storage object

Review of attachment 757408 [details] [diff] [review]:
-----------------------------------------------------------------

looks good
Attachment #757408 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/a40105015f6d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Flags: in-moztrap-
Is this supposed to expose anything to JS on m-c, and if so, did you test that?
Flags: needinfo?(dhylands)
Yes it does and yes I did.

I have an app called ds-test which I used to test it on a leo device (the only device we currently have which has multiple storage areas).
Flags: needinfo?(dhylands)
Depends on: 881386
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: