Bug 993278 - [bluedroid][HFP] Respond OK even if subscriber number information is empty. r=echou, a=1.4+
authorBen Tian <btian@mozilla.com>
Thu, 10 Apr 2014 16:32:54 +0800
changeset 192842 42f4acbeb5833f612e1c48e59fc6e0cb2aba4908
parent 192841 14552046e040b34c56d58e63841f8d3fdac1acaf
child 192843 e23cf1b530f77626fe43554aafc615dcb07b7858
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou, 1
bugs993278
milestone30.0a2
Bug 993278 - [bluedroid][HFP] Respond OK even if subscriber number information is empty. r=echou, a=1.4+
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -638,29 +638,27 @@ void BluetoothHfpManager::ProcessDialCal
   if (!mDialingRequestProcessed) {
     BT_HF_DISPATCH_MAIN(MainThreadTaskCmd::POST_TASK_RESPOND_TO_BLDN);
   }
 }
 
 void
 BluetoothHfpManager::ProcessAtCnum()
 {
-  NS_ENSURE_TRUE_VOID(!mMsisdn.IsEmpty());
-  NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
+  if (!mMsisdn.IsEmpty()) {
+    nsAutoCString message("+CNUM: ,\"");
+    message.Append(NS_ConvertUTF16toUTF8(mMsisdn).get());
+    message.AppendLiteral("\",");
+    message.AppendInt(BTHF_CALL_ADDRTYPE_UNKNOWN);
+    message.AppendLiteral(",,4");
 
-  nsAutoCString message("+CNUM: ,\"");
-  message.Append(NS_ConvertUTF16toUTF8(mMsisdn).get());
-  message.AppendLiteral("\",");
-  message.AppendInt(BTHF_CALL_ADDRTYPE_UNKNOWN);
-  message.AppendLiteral(",,4");
+    SendLine(message.get());
+  }
 
-  NS_ENSURE_TRUE_VOID(BT_STATUS_SUCCESS ==
-    sBluetoothHfpInterface->formatted_at_response(message.get()));
-  NS_ENSURE_TRUE_VOID(BT_STATUS_SUCCESS ==
-    sBluetoothHfpInterface->at_response(BTHF_AT_RESPONSE_OK, 0));
+  SendResponse(BTHF_AT_RESPONSE_OK);
 }
 
 void
 BluetoothHfpManager::ProcessAtCind()
 {
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   int numActive = GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_CONNECTED);