Bug 796733 - Re-order the calling sequence of disable FM radio and change audio state. r=mwu, a=blocking-basecamp
--- a/dom/fm/FMRadio.cpp
+++ b/dom/fm/FMRadio.cpp
@@ -139,24 +139,26 @@ NS_IMETHODIMP FMRadio::Enable(nsIFMRadio
audioManager->SetFmRadioAudioEnabled(true);
return NS_OK;
}
/* void disableRadio (); */
NS_IMETHODIMP FMRadio::Disable()
{
+ // Fix Bug 796733.
+ // DisableFMRadio should be called before SetFmRadioAudioEnabled to prevent
+ // the annoying beep sound.
+ DisableFMRadio();
+
nsCOMPtr<nsIAudioManager> audioManager =
do_GetService(NS_AUDIOMANAGER_CONTRACTID);
NS_ENSURE_TRUE(audioManager, NS_OK);
audioManager->SetFmRadioAudioEnabled(false);
-
- DisableFMRadio();
-
return NS_OK;
}
/* void cancelSeek */
NS_IMETHODIMP FMRadio::CancelSeek()
{
CancelFMRadioSeek();
return NS_OK;