Bug 994411 - [bluez] Ignore pending MO call index, while making MO call with bluetooth headset, r=echou
authorShawn Huang <shuang@mozilla.com>
Thu, 17 Apr 2014 14:26:35 +0800
changeset 197493 efe497928e78d0eda64438537fe0aace763fe490
parent 197492 928c7f656e5b7c1f0cc03f9198c03d57644c906b
child 197494 ebe8ce1da89cb6d97741f8ee7f454f508d1d965e
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs994411
milestone31.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 994411 - [bluez] Ignore pending MO call index, while making MO call with bluetooth headset, r=echou
dom/bluetooth/bluez/BluetoothHfpManager.cpp
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -1387,16 +1387,23 @@ BluetoothHfpManager::HandleCallStateChan
                                             const bool aIsConference,
                                             bool aSend)
 {
   if (!IsConnected()) {
     // Normal case. No need to print out warnings.
     return;
   }
 
+  // aCallIndex can be UINT32_MAX for the pending outgoing call state update.
+  // aCallIndex will be updated again after real call state changes. See Bug
+  // 990467.
+  if (aCallIndex == UINT32_MAX) {
+    return;
+  }
+
   while (aCallIndex >= mCurrentCallArray.Length()) {
     Call call;
     mCurrentCallArray.AppendElement(call);
   }
 
   uint16_t prevCallState = mCurrentCallArray[aCallIndex].mState;
   mCurrentCallArray[aCallIndex].mState = aCallState;
   mCurrentCallArray[aCallIndex].mDirection = !aIsOutgoing;