Last Comment Bug 782351 - Device Storage - Expose sdcard/volume state flag on stat result
: Device Storage - Expose sdcard/volume state flag on stat result
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla17
Assigned To: Doug Turner (:dougt)
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2012-08-13 11:06 PDT by Doug Turner (:dougt)
Modified: 2012-08-27 06:09 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch v.1 (12.51 KB, patch)
2012-08-13 11:15 PDT, Doug Turner (:dougt)
jonas: review+
Details | Diff | Splinter Review
patch v.1 followup (1.27 KB, patch)
2012-08-15 17:20 PDT, Doug Turner (:dougt)
khuey: review+
Details | Diff | Splinter Review
patch v.1 - followup - followup (1.29 KB, patch)
2012-08-22 17:27 PDT, Doug Turner (:dougt)
khuey: review+
Details | Diff | Splinter Review

Description Doug Turner (:dougt) 2012-08-13 11:06:12 PDT

Comment 1 Doug Turner (:dougt) 2012-08-13 11:15:31 PDT
Created attachment 651476 [details] [diff] [review]
patch v.1
Comment 2 Jonas Sicking (:sicking) No longer reading bugmail consistently 2012-08-13 16:19:20 PDT
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.
Comment 4 Ed Morley [:emorley] 2012-08-15 09:48:39 PDT
Comment 5 David Flanagan [:djf] 2012-08-15 16:04:07 PDT
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 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.
Comment 6 David Flanagan [:djf] 2012-08-15 16:17:46 PDT
Testing it OOP shows the same behavior except that the stat error us truncated to "Unknown"
Comment 7 David Flanagan [:djf] 2012-08-15 16:26:10 PDT
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.
Comment 8 Doug Turner (:dougt) 2012-08-15 17:20:11 PDT
Created attachment 652284 [details] [diff] [review]
patch v.1 followup
Comment 10 Ed Morley [:emorley] 2012-08-17 05:26:49 PDT
Comment 11 David Flanagan [:djf] 2012-08-22 15:03:52 PDT
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.
Comment 12 Doug Turner (:dougt) 2012-08-22 17:27:46 PDT
Created attachment 654449 [details] [diff] [review]
patch v.1 - followup - followup

missed a place
Comment 14 :Ms2ger (⌚ UTC+1/+2) 2012-08-27 06:09:48 PDT

Note You need to log in before you can comment on or make changes to this bug.