Closed
Bug 765444
Opened 12 years ago
Closed 12 years ago
Update device storage paths for Gonk
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: dougt, Assigned: dougt)
References
Details
Attachments
(1 file)
2.46 KB,
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → doug.turner
Assignee | ||
Comment 1•12 years ago
|
||
This code is GAIA specific. Asking fabrice to review. This was tested on a Nexus S running B2G from Jun 15. Verified that Gallery worked as expected. This file paths mapped what was on /sdcard/
Attachment #633763 -
Flags: review?(fabrice)
Comment 2•12 years ago
|
||
Did you just change lowercase /sdcard/{pictures,movies,videos} to uppercase /sdcard/{Pictures,Movies,Videos}? Or has it always been that way? I like initial caps better. (But in a gaia code review just made the author of the Music app change from /sdcard/Music to /sdcard/music...) Will the test for existance of /sdcard work in the case where /sdcard is a symbolic link to /mnt/sdcard? I.e if /sdcard points to /mnt/sdcard, but nothing is mounted there, does the test do what you want?
Comment 3•12 years ago
|
||
Fabrice, If you can, please test this on an otoro as part of your review. As similar patch from Doug was not working for me on that device. But perhaps something was misconfigured on mine. Also, note that the changing paths in this patch will require changes to the install-media-samples target in the Gaia Makefile
Comment 4•12 years ago
|
||
Comment on attachment 633763 [details] [diff] [review] patch v.1 Review of attachment 633763 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/devicestorage/nsDeviceStorage.cpp @@ +138,5 @@ > nsCOMPtr<nsIProperties> dirService = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); > NS_ASSERTION(dirService, "Must have directory service"); > > +#ifdef MOZ_WIDGET_GONK > + // check that /sdcard exists, if it doesn't go no further. On an otoro without sdcard, /sdcard exists because it is just a symlink to /mnt/sdcard So this test will pass, but any subsequent write will fail. Can we be smarter here?
Attachment #633763 -
Flags: review?(fabrice)
Updated•12 years ago
|
OS: Mac OS X → Gonk
Hardware: x86 → All
Summary: Update device storage paths for Gaia → Update device storage paths for Gonk
Assignee | ||
Comment 5•12 years ago
|
||
> Can we be smarter here?
Suggest something.
Assignee | ||
Comment 6•12 years ago
|
||
there is a gonk volume manager - maybe there could be something I could query off that?
Comment 7•12 years ago
|
||
(In reply to Doug Turner (:dougt) from comment #6) > there is a gonk volume manager - maybe there could be something I could > query off that? Dave, any hint on how to do that?
Comment 8•12 years ago
|
||
I just finished coding a patch (awaiting some review). Its attached to bug 764228 Basically, you would #include "VolumeManager.h" (Hmm. I may need to export some headers). Then you would RegisterVolumeEventObserver and pass in the string 'sdcard' and an observer object. The Notify method of the observer will be called immediately and each time that the state of the named volume changes. You can look at Volume.h https://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/Volume.h#27 to see the various states. The MOUNTED state means that the volume has been mounted on the phone. You can use the Volume class method MountPoint to get the filesystem location where the volume is mounted. Ideally, you should query the mount point each time the volume enters the MOUNTED state, since technically the mount point could change when the volume is not mounted. In any state other than MOUNTED, the phone is unable to view the contents of the volume. SHARED means that volume is being shared with the PC. I've never seen the state SHARED_MOUNTED, I think it was going to be used for MTP, but that wound up getting implemented differently. The SHARED state means that the volume is being shared with the PC.
Assignee | ||
Comment 9•12 years ago
|
||
sounds like a perfect thing for a follow up bug! Filed bug 765498. Fabrice, would you review as-is?
Updated•12 years ago
|
Attachment #633763 -
Flags: review+
Assignee | ||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c629f31f8218 I'll look at bug 765498 this coming week.
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c629f31f8218
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•