Closed
Bug 989536
Opened 11 years ago
Closed 11 years ago
[DeviceStorage] DeviceStorageFile::GetStatus should always return a valid status.
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
1.4 S5 (11apr)
People
(Reporter: dhylands, Assigned: dhylands)
Details
(Whiteboard: [fxos:media])
Attachments
(1 file)
1.92 KB,
patch
|
janv
:
review+
|
Details | Diff | Splinter Review |
GetStatus should always return one of "unavailable", "available" or "shared".
Line 1525:
http://dxr.mozilla.org/mozilla-central/source/dom/devicestorage/nsDeviceStorage.cpp?from=DeviceStorageFile::GetStatus#1525
should be moved to the beginning of the function.
Comment 1•11 years ago
|
||
I would assume "unavailable" would be for when there is no SD card present and "shared" would remain the same?
Comment 2•11 years ago
|
||
(In reply to Ghislain Aus Lacroix [:aus] from comment #1)
> I would assume "unavailable" would be for when there is no SD card present
> and "shared" would remain the same?
Sorry, I should mention why I'm curious :) The work I'm doing in bug 982006 relies on these strings to determine which type of error it should return.
Currently, based on the code, I check for an empty string to determine that the SD card is simply not present and "shared" and "unavailable" mean the SD card is effectively "busy" because it's mounted to the host PC or being formatted.
I'd like my patch to take these eventual changes into account if I realistically can. If not, I hope that this change would mean my code gets updated, too. :)
Assignee | ||
Comment 3•11 years ago
|
||
"shared" means unavailable because the volume is-about-to-be or is-currently being shared with the PC.
"unavailable" means unavailable for any other reason. Typically this is due to missing media, but it could also happen if the sdcard is being formatted, or otherwise unmountable (corrupt - not a FAT filesystem, etc).
"available" means that the sdcard was successfully mounted and is available for b2g to use.
There shouldn't ever be an empty status (even with the existing code).
If you've ever seen an empty status, I'd like to investigate that.
Assignee | ||
Comment 4•11 years ago
|
||
To get further detailed status information about the volume, you can call:
DeviceStorageFile::StorageStatus(nsAString& aStatus)
This returns "undefined" (if there are no volumes) or one of the following:
http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/nsVolume.cpp#26
I see that function has the same bug that GetStatus does, so I'll fix it at the same time.
Assignee | ||
Comment 5•11 years ago
|
||
Err. That would be:
DeviceStorageFile::GetStorageStatus(nsAString& aStatus)
not StorageStatus
Assignee | ||
Comment 6•11 years ago
|
||
Another very small review.
Attachment #8398831 -
Flags: review?(Jan.Varga)
Updated•11 years ago
|
Attachment #8398831 -
Flags: review?(Jan.Varga) → review+
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Whiteboard: [fxos:media]
Target Milestone: --- → 1.4 S5 (11apr)
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•