Bug 822754 - Fix B2G AutoMounter to deal with out-of-order events. r=philikon

This commit is contained in:
Dave Hylands 2013-01-04 16:19:00 -08:00
parent b18e38dae1
commit 3ea5f09112

View File

@ -52,12 +52,13 @@ Volume::SetMediaPresent(bool aMediaPresent)
// The AutoMounter needs to know whether the media is present or not when
// processing the Idle state.
if (mMediaPresent != aMediaPresent) {
LOG("Volume: %s media %s", NameStr(), aMediaPresent ? "inserted" : "removed");
mMediaPresent = aMediaPresent;
// No need to broadcast the change. A state change will be coming right away,
// and that will serve the purpose.
if (mMediaPresent == aMediaPresent) {
return;
}
LOG("Volume: %s media %s", NameStr(), aMediaPresent ? "inserted" : "removed");
mMediaPresent = aMediaPresent;
mEventObserverList.Broadcast(this);
}
void