From a88d6cad39c2abce9f40e954a604a45c268b7443 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Fri, 21 Jun 2013 01:37:21 -0400 Subject: [PATCH] Bug 885602 - Fix build of AudioManager.cpp on gonk-JB, r=mchen --- dom/system/gonk/AudioManager.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dom/system/gonk/AudioManager.cpp b/dom/system/gonk/AudioManager.cpp index 7eaaed5da545..b1d272d8451a 100644 --- a/dom/system/gonk/AudioManager.cpp +++ b/dom/system/gonk/AudioManager.cpp @@ -284,11 +284,11 @@ AudioManager::AudioManager() : mPhoneState(PHONE_STATE_CURRENT), nsCOMPtr 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++) { @@ -316,11 +316,11 @@ AudioManager::~AudioManager() { nsCOMPtr 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!"); } }