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 179426 efe497928e78d0eda64438537fe0aace763fe490
parent 179425 928c7f656e5b7c1f0cc03f9198c03d57644c906b
child 179427 ebe8ce1da89cb6d97741f8ee7f454f508d1d965e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersechou
bugs994411
milestone31.0a1
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;