Bug 942712 - Set gToggleInProgress to false when bt toggling is done, r=gyeh
☠☠ backed out by acb441feff28 ☠ ☠
authorEric Chou <echou@mozilla.com>
Thu, 28 Nov 2013 17:48:53 +0800
changeset 172727 097a3702af4f54dec3fdf05e313f8990ad7cf1d2
parent 172726 4ba83d2a3fe5f570524302a26bba3f9a964f1e4b
child 172728 b064b9271e0e6fa04151fa42b494eff1edb17441
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgyeh
bugs942712
milestone28.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 942712 - Set gToggleInProgress to false when bt toggling is done, r=gyeh
dom/bluetooth/BluetoothService.cpp
--- a/dom/bluetooth/BluetoothService.cpp
+++ b/dom/bluetooth/BluetoothService.cpp
@@ -151,16 +151,17 @@ public:
     if (gInShutdown) {
       gBluetoothService = nullptr;
       return NS_OK;
     }
 
     // Update mEnabled of BluetoothService object since
     // StartInternal/StopInternal have been already done.
     gBluetoothService->SetEnabled(mEnabled);
+    gToggleInProgress = false;
 
     nsAutoString signalName;
     signalName = mEnabled ? NS_LITERAL_STRING("Enabled")
                           : NS_LITERAL_STRING("Disabled");
     BluetoothSignal signal(signalName, NS_LITERAL_STRING(KEY_MANAGER), true);
     gBluetoothService->DistributeSignal(signal);
 
     return NS_OK;
@@ -542,18 +543,16 @@ BluetoothService::SetEnabled(bool aEnabl
    * aEnabled: expected status of bluetooth
    */
   if (mEnabled == aEnabled) {
     BT_WARNING("Bluetooth has already been enabled/disabled before\
                 or the toggling is failed.");
   }
 
   mEnabled = aEnabled;
-
-  gToggleInProgress = false;
 }
 
 nsresult
 BluetoothService::HandleStartup()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!gToggleInProgress);