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

RESOLVED FIXED in mozilla17

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dougt, Assigned: dougt)

Tracking

unspecified
mozilla17
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
Created attachment 651476 [details] [diff] [review]
patch v.1
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+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c4e3f8254b4
https://hg.mozilla.org/mozilla-central/rev/8c4e3f8254b4
Status: NEW → RESOLVED
Last Resolved: 5 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.
(Assignee)

Comment 8

5 years ago
Created attachment 652284 [details] [diff] [review]
patch v.1 followup
Attachment #652284 - Flags: review?(khuey)
Attachment #652284 - Flags: review?(khuey) → review+
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/57c7f49b37b3
https://hg.mozilla.org/mozilla-central/rev/57c7f49b37b3
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 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 → ---
(Assignee)

Comment 12

5 years ago
Created attachment 654449 [details] [diff] [review]
patch v.1 - followup - followup

missed a place
Attachment #654449 - Flags: review?(khuey)
Attachment #654449 - Flags: review?(khuey) → review+
(Assignee)

Comment 13

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/59f82234c8d9
https://hg.mozilla.org/mozilla-central/rev/59f82234c8d9
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.