Bug 942712 - Set gToggleInProgress to false when bt toggling is done, r=gyeh
authorEric Chou <echou@mozilla.com>
Tue, 26 Nov 2013 15:13:43 +0800
changeset 172761 31306f1b7891d7bf7d312dc0fcc589ad96889c5b
parent 172760 43e242408cda4269deb3ce74ce993fe6ff3b6577
child 172762 d27d0489b68998bfd9434a22c434ef2a07a51f93
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 From 2e8e1d84251fac968caf9104536d1b794c986670 Mon Sep 17 00:00:00 2001
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);