Bug 953159 - Handle antenna switch state unknown error in fm. r=pzhang
authorVasanthakumar Pandurangan <vasanth@codeaurora.org>
Fri, 27 Dec 2013 11:18:40 +0530
changeset 162010 564ec4c037622c2ed5166f4a093b45eb1b028f4a
parent 162009 adf55196426d06d66a20e28748ed0ad3f628c238
child 162011 f2ca8cdcc25a5a5b43acdd7955100d194e4a8d21
push id25923
push userkwierso@gmail.com
push dateFri, 03 Jan 2014 03:54:12 +0000
treeherdermozilla-central@faa8ab5bb9ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspzhang
bugs953159
milestone29.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 953159 - Handle antenna switch state unknown error in fm. r=pzhang
dom/fmradio/FMRadio.cpp
--- a/dom/fmradio/FMRadio.cpp
+++ b/dom/fmradio/FMRadio.cpp
@@ -229,17 +229,18 @@ bool
 FMRadio::Enabled()
 {
   return IFMRadioService::Singleton()->IsEnabled();
 }
 
 bool
 FMRadio::AntennaAvailable() const
 {
-  return mHasInternalAntenna ? true : mHeadphoneState != SWITCH_STATE_OFF;
+  return mHasInternalAntenna ? true : (mHeadphoneState != SWITCH_STATE_OFF) &&
+    (mHeadphoneState != SWITCH_STATE_UNKNOWN);
 }
 
 Nullable<double>
 FMRadio::GetFrequency() const
 {
   return Enabled() ?
     Nullable<double>(IFMRadioService::Singleton()->GetFrequency()) :
     Nullable<double>();