Bug 885602 - Fix build of AudioManager.cpp on gonk-JB, r=mchen
authorMichael Wu <mwu@mozilla.com>
Fri, 21 Jun 2013 01:37:21 -0400
changeset 147371 4ec6133f6ed4ec8d96e0cb0ad92896b1ab5ffd88
parent 147370 79d5c72370471e34829af7587293723960f801fe
child 147372 17908e758303367dcfb9dfc30cf37fa8dc0555af
child 147593 e58b14308cad09b23d417e18544c8ef23e66189b
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchen
bugs885602
milestone24.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 885602 - Fix build of AudioManager.cpp on gonk-JB, r=mchen
dom/system/gonk/AudioManager.cpp
--- a/dom/system/gonk/AudioManager.cpp
+++ b/dom/system/gonk/AudioManager.cpp
@@ -279,21 +279,21 @@ AudioManager::AudioManager() : mPhoneSta
 {
   RegisterSwitchObserver(SWITCH_HEADPHONES, mObserver);
 
   InternalSetAudioRoutes(GetCurrentSwitchState(SWITCH_HEADPHONES));
   NotifyHeadphonesStatus(GetCurrentSwitchState(SWITCH_HEADPHONES));
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   NS_ENSURE_TRUE_VOID(obs);
-  nsresult rv =
-    obs->AddObserver(this, BLUETOOTH_SCO_STATUS_CHANGED_ID, false) &&
-    obs->AddObserver(this, BLUETOOTH_A2DP_STATUS_CHANGED_ID, false);
-  if (NS_FAILED(rv)) {
-    NS_WARNING("Failed to add bluetooth status changed obervers!");
+  if (NS_FAILED(obs->AddObserver(this, BLUETOOTH_SCO_STATUS_CHANGED_ID, false))) {
+    NS_WARNING("Failed to add bluetooth sco status changed observer!");
+  }
+  if (NS_FAILED(obs->AddObserver(this, BLUETOOTH_A2DP_STATUS_CHANGED_ID, false))) {
+    NS_WARNING("Failed to add bluetooth a2dp status changed observer!");
   }
 
   for (int loop = 0; loop < AUDIO_STREAM_CNT; loop++) {
     AudioSystem::initStreamVolume(static_cast<audio_stream_type_t>(loop), 0,
                                   sMaxStreamVolumeTbl[loop]);
     mCurrentStreamVolumeTbl[loop] = sMaxStreamVolumeTbl[loop];
   }
   // Force publicnotification to output at maximal volume
@@ -311,21 +311,21 @@ AudioManager::AudioManager() : mPhoneSta
   AudioSystem::setErrorCallback(BinderDeadCallback);
 }
 
 AudioManager::~AudioManager() {
   UnregisterSwitchObserver(SWITCH_HEADPHONES, mObserver);
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   NS_ENSURE_TRUE_VOID(obs);
-  nsresult rv =
-    obs->RemoveObserver(this, BLUETOOTH_SCO_STATUS_CHANGED_ID) &&
-    obs->RemoveObserver(this, BLUETOOTH_A2DP_STATUS_CHANGED_ID);
-  if (NS_FAILED(rv)) {
-    NS_WARNING("Failed to remove bluetooth status changed obervers!");
+  if (NS_FAILED(obs->RemoveObserver(this, BLUETOOTH_SCO_STATUS_CHANGED_ID))) {
+    NS_WARNING("Failed to remove bluetooth sco status changed observer!");
+  }
+  if (NS_FAILED(obs->RemoveObserver(this, BLUETOOTH_A2DP_STATUS_CHANGED_ID))) {
+    NS_WARNING("Failed to remove bluetooth a2dp status changed observer!");
   }
 }
 
 NS_IMETHODIMP
 AudioManager::GetMicrophoneMuted(bool* aMicrophoneMuted)
 {
   if (AudioSystem::isMicrophoneMuted(aMicrophoneMuted)) {
     return NS_ERROR_FAILURE;