Closed Bug 874213 Opened 7 years ago Closed 7 years ago
Storage: Add a .default attribute to the device storage object .
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+
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Is this supposed to expose anything to JS on m-c, and if so, did you test that?
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).
You need to log in before you can comment on or make changes to this bug.