Backed out changeset 95e956a2ddb9 (bug 1147736)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 06 May 2015 17:02:35 +0200
changeset 242547 2dc903ac0c3c1e8566525c7d413aad2ffcb03bdb
parent 242546 79432e5c931a15f9a8c13e4621142dcff481459e
child 242548 ec6f7f1add4b04fb5ca07915a5a4a931bb2ed34e
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 out95e956a2ddb926fc79a61d80bad4a26035f354b0
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 95e956a2ddb9 (bug 1147736)
dom/telephony/Telephony.cpp
dom/telephony/ipc/PTelephony.ipdl
dom/telephony/ipc/TelephonyChild.cpp
dom/telephony/ipc/TelephonyChild.h
dom/telephony/ipc/TelephonyIPCService.cpp
dom/telephony/ipc/TelephonyParent.cpp
dom/telephony/nsITelephonyService.idl
--- a/dom/telephony/Telephony.cpp
+++ b/dom/telephony/Telephony.cpp
@@ -689,16 +689,36 @@ Telephony::SupplementaryServiceNotificat
       return NS_ERROR_UNEXPECTED;
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+Telephony::NotifyError(uint32_t aServiceId,
+                       int32_t aCallIndex,
+                       const nsAString& aError)
+{
+  nsRefPtr<TelephonyCall> callToNotify =
+    GetCallFromEverywhere(aServiceId, aCallIndex);
+  if (!callToNotify) {
+    NS_ERROR("Don't call me with a bad call index!");
+    return NS_ERROR_UNEXPECTED;
+  }
+
+  // Set the call state to 'disconnected' and remove it from the calls list.
+  callToNotify->UpdateDisconnectedReason(aError);
+  callToNotify->NotifyError(aError);
+  callToNotify->ChangeState(nsITelephonyService::CALL_STATE_DISCONNECTED);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber,
                                  uint16_t aNumberPresentation,
                                  const nsAString& aName,
                                  uint16_t aNamePresentation)
 {
   MOZ_ASSERT(mCalls.Length() == 1);
 
   nsRefPtr<TelephonyCall> callToNotify = mCalls[0];
--- a/dom/telephony/ipc/PTelephony.ipdl
+++ b/dom/telephony/ipc/PTelephony.ipdl
@@ -120,16 +120,18 @@ union IPCTelephonyRequest
   SendTonesRequest;
 };
 
 sync protocol PTelephony {
   manager PContent;
   manages PTelephonyRequest;
 
 child:
+  NotifyCallError(uint32_t aClientId, int32_t aCallIndex, nsString aError);
+
   NotifyCallStateChanged(nsTelephonyCallInfo[] aAllInfo);
 
   NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
 
   NotifyConferenceCallStateChanged(uint16_t aCallState);
 
   NotifyConferenceError(nsString aName, nsString aMessage);
 
--- a/dom/telephony/ipc/TelephonyChild.cpp
+++ b/dom/telephony/ipc/TelephonyChild.cpp
@@ -43,16 +43,27 @@ TelephonyChild::AllocPTelephonyRequestCh
 bool
 TelephonyChild::DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor)
 {
   delete aActor;
   return true;
 }
 
 bool
+TelephonyChild::RecvNotifyCallError(const uint32_t& aClientId,
+                                    const int32_t& aCallIndex,
+                                    const nsString& aError)
+{
+  MOZ_ASSERT(mService);
+
+  mService->NotifyError(aClientId, aCallIndex, aError);
+  return true;
+}
+
+bool
 TelephonyChild::RecvNotifyCallStateChanged(nsTArray<nsITelephonyCallInfo*>&& aAllInfo)
 {
   uint32_t length = aAllInfo.Length();
   nsTArray<nsCOMPtr<nsITelephonyCallInfo>> results;
   for (uint32_t i = 0; i < length; ++i) {
     // Use dont_AddRef here because this instance has already been AddRef-ed in
     // TelephonyIPCSerializer.h
     nsCOMPtr<nsITelephonyCallInfo> info = dont_AddRef(aAllInfo[i]);
--- a/dom/telephony/ipc/TelephonyChild.h
+++ b/dom/telephony/ipc/TelephonyChild.h
@@ -30,16 +30,20 @@ protected:
 
   virtual PTelephonyRequestChild*
   AllocPTelephonyRequestChild(const IPCTelephonyRequest& aRequest) override;
 
   virtual bool
   DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor) override;
 
   virtual bool
+  RecvNotifyCallError(const uint32_t& aClientId, const int32_t& aCallIndex,
+                      const nsString& aError) override;
+
+  virtual bool
   RecvNotifyCallStateChanged(nsTArray<nsITelephonyCallInfo*>&& aAllInfo) override;
 
   virtual bool
   RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
                             const IPCCdmaWaitingCallData& aData) override;
 
   virtual bool
   RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) override;
--- a/dom/telephony/ipc/TelephonyIPCService.cpp
+++ b/dom/telephony/ipc/TelephonyIPCService.cpp
@@ -417,16 +417,26 @@ TelephonyIPCService::NotifyConferenceErr
 {
   for (uint32_t i = 0; i < mListeners.Length(); i++) {
     mListeners[i]->NotifyConferenceError(aName, aMessage);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
+TelephonyIPCService::NotifyError(uint32_t aClientId, int32_t aCallIndex,
+                                  const nsAString& aError)
+{
+  for (uint32_t i = 0; i < mListeners.Length(); i++) {
+    mListeners[i]->NotifyError(aClientId, aCallIndex, aError);
+  }
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 TelephonyIPCService::SupplementaryServiceNotification(uint32_t aClientId,
                                                        int32_t aCallIndex,
                                                        uint16_t aNotification)
 {
   for (uint32_t i = 0; i < mListeners.Length(); i++) {
     mListeners[i]->SupplementaryServiceNotification(aClientId, aCallIndex,
                                                     aNotification);
   }
--- a/dom/telephony/ipc/TelephonyParent.cpp
+++ b/dom/telephony/ipc/TelephonyParent.cpp
@@ -327,16 +327,27 @@ TelephonyParent::NotifyConferenceError(c
 {
   NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
 
   return SendNotifyConferenceError(nsString(aName), nsString(aMessage)) ? NS_OK
                                                                         : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
+TelephonyParent::NotifyError(uint32_t aClientId,
+                             int32_t aCallIndex,
+                             const nsAString& aError)
+{
+  NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
+
+  return SendNotifyCallError(aClientId, aCallIndex, nsString(aError))
+      ? NS_OK : NS_ERROR_FAILURE;
+}
+
+NS_IMETHODIMP
 TelephonyParent::SupplementaryServiceNotification(uint32_t aClientId,
                                                   int32_t aCallIndex,
                                                   uint16_t aNotification)
 {
   NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
 
   return SendNotifySupplementaryService(aClientId, aCallIndex, aNotification)
       ? NS_OK : NS_ERROR_FAILURE;
@@ -416,16 +427,24 @@ TelephonyRequestParent::NotifyCdmaCallWa
 NS_IMETHODIMP
 TelephonyRequestParent::NotifyConferenceError(const nsAString& aName,
                                               const nsAString& aMessage)
 {
   MOZ_CRASH("Not a TelephonyParent!");
 }
 
 NS_IMETHODIMP
+TelephonyRequestParent::NotifyError(uint32_t aClientId,
+                                    int32_t aCallIndex,
+                                    const nsAString& aError)
+{
+  MOZ_CRASH("Not a TelephonyParent!");
+}
+
+NS_IMETHODIMP
 TelephonyRequestParent::SupplementaryServiceNotification(uint32_t aClientId,
                                                          int32_t aCallIndex,
                                                          uint16_t aNotification)
 {
   MOZ_CRASH("Not a TelephonyParent!");
 }
 
 // nsITelephonyDialCallback
--- a/dom/telephony/nsITelephonyService.idl
+++ b/dom/telephony/nsITelephonyService.idl
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIMobileCallForwardingOptions;
 interface nsITelephonyCallInfo;
 
-[scriptable, uuid(80faf34e-286b-4487-bd55-135bd92668b9)]
+[scriptable, uuid(37fb45bb-ae10-4cfd-b24e-d656a9787a0a)]
 interface nsITelephonyListener : nsISupports
 {
   /**
    * Called when enumeration asked by nsITelephonyService::enumerateCalls
    * is completed.
    */
   void enumerateCallStateComplete();
 
@@ -50,16 +50,30 @@ interface nsITelephonyListener : nsISupp
    * @param notification
    *        One of the nsITelephonyService::NOTIFICATION_* values.
    */
   void supplementaryServiceNotification(in unsigned long clientId,
                                         in long callIndex,
                                         in unsigned short notification);
 
   /**
+   * Called when RIL error occurs.
+   *
+   * @param clientId
+            Indicate the RIL client, 0 ~ (number of client - 1).
+   * @param callIndex
+   *        Call identifier assigned by the RIL. -1 if no connection
+   * @param error
+   *        Error from RIL.
+   */
+  void notifyError(in unsigned long clientId,
+                   in long callIndex,
+                   in AString error);
+
+  /**
    * Called when a waiting call comes in CDMA networks.
    *
    * @param clientId
             Indicate the RIL client, 0 ~ (number of client - 1).
    * @param number
    *        Number of the other party.
    * @param numberPresentation
    *        Presentation of the call number.