Bug 1147736 - Part 3: Deprecate NotifyError. r=aknow
☠☠ backed out by 2dc903ac0c3c ☠ ☠
authorBen Hsu <bhsu@mozilla.com>
Mon, 27 Apr 2015 23:29:00 -0400
changeset 242540 95e956a2ddb926fc79a61d80bad4a26035f354b0
parent 242539 a78ad976faf317828b6cb268dced774e863b6b80
child 242541 0098029a7bddd6af650f4972d87f88637fbeae1d
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)
reviewersaknow
bugs1147736
milestone40.0a1
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
Bug 1147736 - Part 3: Deprecate NotifyError. r=aknow
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,36 +689,16 @@ 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,18 +120,16 @@ 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,27 +43,16 @@ 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,20 +30,16 @@ 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,26 +417,16 @@ 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,27 +327,16 @@ 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;
@@ -427,24 +416,16 @@ 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(37fb45bb-ae10-4cfd-b24e-d656a9787a0a)]
+[scriptable, uuid(80faf34e-286b-4487-bd55-135bd92668b9)]
 interface nsITelephonyListener : nsISupports
 {
   /**
    * Called when enumeration asked by nsITelephonyService::enumerateCalls
    * is completed.
    */
   void enumerateCallStateComplete();
 
@@ -50,30 +50,16 @@ 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.