Bug 823455 - Patch 1: Fire ondisabled/onenabled event when toggling is failed, r=echou
authorGina Yeh <gyeh@mozilla.com>
Fri, 21 Dec 2012 18:22:58 +0800
changeset 125865 3c416caff855bde907fd9b2665dafee451a9d976
parent 125864 b323378d9d2764536065cb5f59310901562e1015
child 125866 c55e10ab852dba03188f9b93ff35c1d6309f691f
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs823455
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 823455 - Patch 1: Fire ondisabled/onenabled event when toggling is failed, r=echou
dom/bluetooth/BluetoothService.cpp
--- a/dom/bluetooth/BluetoothService.cpp
+++ b/dom/bluetooth/BluetoothService.cpp
@@ -425,25 +425,18 @@ BluetoothService::SetEnabled(bool aEnabl
     mBluetoothSignalObserverTable.Clear();
   }
 
   /**
    * mEnabled: real status of bluetooth
    * 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;
 
   // Fire onenabled/ondisabled event for each BluetoothManager
   BluetoothManagerList::ForwardIterator iter(mLiveManagers);
   while (iter.HasMore()) {
     if (NS_FAILED(iter.GetNext()->FireEnabledDisabledEvent(aEnabled))) {