Closed Bug 766296 Opened 10 years ago Closed 10 years ago

USB Mass Storage AutoMounter doesn't deal with card insertion/removal properly

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dhylands, Assigned: dhylands)

References

Details

Attachments

(1 file, 1 obsolete file)

If you remove/insert the physical SD card, then the AutoMounter doesn't update the state until you go through a lock/unlock cycle, or sometimes a disable/enable of the setting.

This is causes because the AutoMounter doesn't call UpdateState on card insertion/removal events.
Assignee: nobody → dhylands
Depends on: 764228
- Moved parsing of volume state from the VolumeManager class to the Volume class
- The AutoMounter now registers for notification of Volume changes
- Added detection of SD card removal/insertion
Attachment #635186 - Flags: review?(kyle)
Comment on attachment 635186 [details] [diff] [review]
Bug 766296 - Make AutoMounter notice SD Card insertion and removal

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

::: dom/system/gonk/AutoMounter.cpp
@@ +250,3 @@
>    RefPtr<VolumeResponseCallback>  mResponseCallback;
>    int32_t                         mMode;
> +  std::vector<RefPtr<Volume> >    mAutoVolume;

Any reason this is a vector versus an nsTArray? (legitimate question, I've just taken to avoiding all STL containers now, though I've used queue/deque places before I knew about nsTArray)
Attachment #635186 - Flags: review?(kyle) → review+
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #2)
> Comment on attachment 635186 [details] [diff] [review]
> Bug 766296 - Make AutoMounter notice SD Card insertion and removal
> 
> Review of attachment 635186 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/system/gonk/AutoMounter.cpp
> @@ +250,3 @@
> >    RefPtr<VolumeResponseCallback>  mResponseCallback;
> >    int32_t                         mMode;
> > +  std::vector<RefPtr<Volume> >    mAutoVolume;
> 
> Any reason this is a vector versus an nsTArray? (legitimate question, I've
> just taken to avoiding all STL containers now, though I've used queue/deque
> places before I knew about nsTArray)

When I originally coded the VolumeManager stuff I used std::queue because I didn't find any other ns classes that provided the same functionality. Does nsTArray provide queue semantics?

cjones said it was fine to use STL in the gonk code, and I was familiar with it, so I used it.

And the vector stuff was already in the AutoMounter. For this bug fix, I just moved it.
- Moved parsing of volume state from the VolumeManager class to the Volume class
- The AutoMounter now registers for notification of Volume changes
- Added detection of SD card removal/insertion


Rebased now wthat bug 764228 has been reviewed. Changed std::vector to use nsTArray instead.
Attachment #635186 - Attachment is obsolete: true
Attachment #637397 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/c0a8cbdb0a70
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.