Bug 994411 - [bluedroid] Ignore pending MO call index, while making MO call with bluetooth headset, r=echou
authorShawn Huang <shuang@mozilla.com>
Thu, 17 Apr 2014 17:38:28 +0800
changeset 179525 bc0034c4496c3ef61e94486120717e5820a11c96
parent 179524 7113f6dd5cdc328cdb5b017d0edd4732db5d58cd
child 179526 13b8dd8c3715e5ad7248747f6eaadb3b744dc1b5
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersechou
bugs994411
milestone31.0a1
Bug 994411 - [bluedroid] Ignore pending MO call index, while making MO call with bluetooth headset, r=echou
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -1096,16 +1096,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);
   }
 
   mCurrentCallArray[aCallIndex].mState = aCallState;
   mCurrentCallArray[aCallIndex].mNumber = aNumber;
   mCurrentCallArray[aCallIndex].mDirection = (aIsOutgoing) ?