Closed Bug 782351 Opened 12 years ago Closed 12 years ago

Device Storage - Expose sdcard/volume state flag on stat result

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(3 files)

      No description provided.
Attached patch patch v.1Splinter Review
Attachment #651476 - Flags: review?(jonas)
Comment on attachment 651476 [details] [diff] [review]
patch v.1

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

::: dom/interfaces/devicestorage/nsIDOMDeviceStorageStat.idl
@@ +9,5 @@
>  {
>    readonly attribute PRUint64 totalBytes;
>    readonly attribute PRUint64 freeBytes;
> +
> +  // shared, available, unavailable

I'd put quotes around these for clarity.
Attachment #651476 - Flags: review?(jonas) → review+
https://hg.mozilla.org/mozilla-central/rev/8c4e3f8254b4
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
This is not working for me in the Gallery app.

If /sdcard is in the "shared" or "unavailable" state, then calling stat() never returns a result to onsuccess.

Instead, onerror is called with request.error.name set to:

  Unknown file path = /sdcard/DCIM path = 

It looks to me like the only time stat() works is when the card is already in the available state.

This was tested on the otoro with the Gallery app temporarily blacklisted.  Haven't tested it OOP.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Testing it OOP shows the same behavior except that the stat error us truncated to "Unknown"
I've landed a change to the Gaia app to track this change.  If you use the latest Gallery app, you can confirm that the onerror() handler of the stat() request is being called if there is no sdcard or if it is mouned for UMS.
Attachment #652284 - Flags: review?(khuey)
https://hg.mozilla.org/mozilla-central/rev/57c7f49b37b3
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
I've reopened this because it is not working for OOP processes.

Gallery is now OOP. If I call stat with no card or during USB Mass Storage, the onerror handler on the stat request is triggered.  

But screenshots are in process as part of the system app.  And they get correct results when calling stat() in either of those two conditions.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
missed a place
Attachment #654449 - Flags: review?(khuey)
https://hg.mozilla.org/mozilla-central/rev/59f82234c8d9
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: