Bug 823455 - Patch 1: Fire ondisabled/onenabled event when toggling is failed, r=echou

This commit is contained in:
Gina Yeh 2012-12-21 18:22:58 +08:00
parent 312348755c
commit d7405c6410

View File

@ -430,15 +430,8 @@ BluetoothService::SetEnabled(bool aEnabled)
* aEnabled: expected status of bluetooth
*/
if (mEnabled == aEnabled) {
/**
* The process of toggling should be over here, so we set gToggleInProgress
* back to false here. Note that, we don't fire onenabled/ondisabled in
* this case.
*/
NS_WARNING("Bluetooth has already been enabled/disabled before.\
Skip fire onenabled/ondisabled events here.");
gToggleInProgress = false;
return;
NS_WARNING("Bluetooth has already been enabled/disabled before\
or the toggling is failed.");
}
mEnabled = aEnabled;