Bug 796733 - Re-order the calling sequence of disable FM radio and change audio state. r=mwu
authorSteven Lee <slee@mozilla.com>
Thu, 11 Oct 2012 21:31:39 -0400
changeset 110008 e513d3aa6a1e5491e3ef47c50df1747d76092009
parent 110007 2af93a18b6b166b49c024e67845924f27b924409
child 110009 887b293a2fd396dd012d292f36797727c7049553
push id16326
push userryanvm@gmail.com
push dateFri, 12 Oct 2012 01:31:45 +0000
treeherdermozilla-inbound@e05e9c4666e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs796733
milestone19.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 796733 - Re-order the calling sequence of disable FM radio and change audio state. r=mwu
dom/fm/FMRadio.cpp
--- 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;