Bug 796733 - Re-order the calling sequence of disable FM radio and change audio state. r=mwu

This commit is contained in:
Steven Lee 2012-10-11 21:31:39 -04:00
parent f0423b1f36
commit 9be044e05a

View File

@ -144,14 +144,16 @@ NS_IMETHODIMP FMRadio::Enable(nsIFMRadioSettings *settings)
/* 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;
}