Backed out changeset 0098029a7bdd (bug 1147736)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 06 May 2015 17:02:31 +0200
changeset 242546 79432e5c931a15f9a8c13e4621142dcff481459e
parent 242545 fe169f6b08ad1402047e14fc9c626acc968d38cd
child 242547 2dc903ac0c3c1e8566525c7d413aad2ffcb03bdb
push id28699
push userryanvm@gmail.com
push dateWed, 06 May 2015 20:01:37 +0000
treeherdermozilla-central@b2a742938d64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1147736
milestone40.0a1
backs out0098029a7bddd6af650f4972d87f88637fbeae1d
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 0098029a7bdd (bug 1147736)
dom/bluetooth/BluetoothRilListener.cpp
--- a/dom/bluetooth/BluetoothRilListener.cpp
+++ b/dom/bluetooth/BluetoothRilListener.cpp
@@ -198,33 +198,26 @@ nsresult
 TelephonyListener::HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend)
 {
   BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
   NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
 
   uint32_t callIndex;
   uint16_t callState;
   nsAutoString number;
-  nsAutoString disconnectedReason;
   bool isOutgoing;
   bool isConference;
 
   aInfo->GetCallIndex(&callIndex);
   aInfo->GetCallState(&callState);
   aInfo->GetNumber(number);
-  aInfo->GetDisconnectedReason(disconnectedReason);
   aInfo->GetIsOutgoing(&isOutgoing);
   aInfo->GetIsConference(&isConference);
 
-  // The disconnectedReason of a disconnected call must be nonempty no matter
-  // the call is disconnected for a normal reason or an error.
-  MOZ_ASSERT((callState != nsITelephonyService::CALL_STATE_DISCONNECTED ||
-              !disconnectedReason.isEmpty()),
-             "disconnectedReason of an disconnected call must be nonempty.");
-  hfp->HandleCallStateChanged(callIndex, callState, disconnectedReason, number,
+  hfp->HandleCallStateChanged(callIndex, callState, EmptyString(), number,
                               isOutgoing, isConference, aSend);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TelephonyListener::CallStateChanged(uint32_t aLength,
                                     nsITelephonyCallInfo** aAllInfo)
 {
@@ -236,16 +229,40 @@ TelephonyListener::CallStateChanged(uint
 
 NS_IMETHODIMP
 TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo)
 {
   return HandleCallInfo(aInfo, false);
 }
 
 NS_IMETHODIMP
+TelephonyListener::NotifyError(uint32_t aServiceId,
+                               int32_t aCallIndex,
+                               const nsAString& aError)
+{
+  BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
+  NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
+
+  if (aCallIndex > 0) {
+    // In order to not miss any related call state transition.
+    // It's possible that 3G network signal lost for unknown reason.
+    // If a call is released abnormally, NotifyError() will be called,
+    // instead of CallStateChanged(). We need to reset the call array state
+    // via setting CALL_STATE_DISCONNECTED
+    hfp->HandleCallStateChanged(aCallIndex,
+                                nsITelephonyService::CALL_STATE_DISCONNECTED,
+                                aError, EmptyString(), false, false, true);
+    BT_WARNING("Reset the call state due to call transition ends abnormally");
+  }
+
+  BT_WARNING(NS_ConvertUTF16toUTF8(aError).get());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 TelephonyListener::ConferenceCallStateChanged(uint16_t aCallState)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TelephonyListener::EnumerateCallStateComplete()
 {