[Device][Storage] unmount API should respond onerror while the storage is locked.



5 years ago
a year ago


(Reporter: iliu, Unassigned)


Firefox Tracking Flags

(Not tracked)


Since implemented SD card management user story for unmount storage, we find out unmount API will pend the request until storage unlocked. It should respond onerror case while it cannot unmount storage immediately. Please reference STR from bug 1060196.

Comment 1

5 years ago
Hi Dave, can we make the change at gecko side? Thank you.
Flags: needinfo?(dhylands)
We can do a best effort on the gecko side.

So part of the answer depends on the definition of immediately.

We need to check to make sure that there are no open files.
We need to check to make sure that there are no mount locks being held.
We need to try to unmount and get the success or failure back from vold.

There will always be races since somebody can open a file after we've done our check, but fundamentally, I don't see any reason why we can't ensure that either onerror or onsuccess gets called, and we can make it so that unmounting fails if there are files open.

Currently when we share, we fake changing the state, which will cause apps like music to close the files, and we wait for the app to close the files before actually starting the share.

We could make unmount not delay and fail, or we could make it fake the state and wait (perhaps it should be an option?)
Flags: needinfo?(dhylands)
Looks like unmount() API have more ability which is not exposed. For the requirement, per offline discussion with UX in bug 1060196, the expect result is "Pop-up a dialog to inform user that he could not eject SD card when files are using now". I would like to make unmount not delay and fail if we're not able to unmount the storage immediately. And we could pop out a dialog to inform user via the onerror case.
Update the latest status,
on flame, the behavior is similar to the way Dave mentioned in Comment 2.
The music will close the file immediately when we eject the SD card.
I think this is acceptable.

However, the behavior is weird on Helix. (Bug 1060196)
I will look into it and try this on unagi as well.

Comment 5

a year ago
Firefox OS is not being worked on
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.