Backed out changeset 129a238dbe1f (bug 889730) for B2G debug bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 16 Jul 2013 11:56:00 -0400
changeset 138712 1b93158f0bf7ecdd3743afa7d1fa158796eaf8f7
parent 138711 ecc66980e9c8f07ba1b9cef658a00432df10fa98
child 138713 433ebb4c854b9241d714b0a0e570e612dc1d915e
push id24964
push userryanvm@gmail.com
push dateTue, 16 Jul 2013 20:04:09 +0000
treeherderautoland@fd10ead17ace [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs889730
milestone25.0a1
backs out129a238dbe1f3e2c47a768f4bfdd49a392426567
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
Backed out changeset 129a238dbe1f (bug 889730) for B2G debug bustage.
dom/system/gonk/AudioChannelManager.cpp
dom/system/gonk/AudioChannelManager.h
--- a/dom/system/gonk/AudioChannelManager.cpp
+++ b/dom/system/gonk/AudioChannelManager.cpp
@@ -36,16 +36,22 @@ JSObject*
 AudioChannelManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return AudioChannelManagerBinding::Wrap(aCx, aScope, this);
 }
 
 void
 AudioChannelManager::Notify(const SwitchEvent& aEvent)
 {
-  mState = aEvent.status();
+  if (aEvent.status() == SWITCH_STATE_ON ||
+      aEvent.status() == SWITCH_STATE_HEADSET ||
+      aEvent.status() == SWITCH_STATE_HEADPHONE) {
+    mState = SWITCH_STATE_ON;
+  } else {
+    mState = SWITCH_STATE_OFF;
+  }
 
   DispatchTrustedEvent(NS_LITERAL_STRING("headphoneschange"));
 }
 
 } // namespace system
 } // namespace dom
 } // namespace mozilla
--- a/dom/system/gonk/AudioChannelManager.h
+++ b/dom/system/gonk/AudioChannelManager.h
@@ -38,18 +38,17 @@ public:
      return GetOwner();
   }
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   bool Headphones() const
   {
-    MOZ_ASSERT(mState != SWITCH_STATE_UNKNOWN);
-    return mState != hal::SWITCH_STATE_OFF;
+    return mState == hal::SWITCH_STATE_ON;
   }
 
   IMPL_EVENT_HANDLER(headphoneschange)
 
 private:
   hal::SwitchState mState;
 };