diff --git a/dom/telephony/Telephony.cpp b/dom/telephony/Telephony.cpp index a6756557262c..d947b88dbbf7 100644 --- a/dom/telephony/Telephony.cpp +++ b/dom/telephony/Telephony.cpp @@ -59,7 +59,6 @@ class Telephony::Callback : public nsITelephonyCallback nsRefPtr mTelephony; nsRefPtr mPromise; uint32_t mServiceId; - nsString mNumber; virtual ~Callback() {} @@ -68,8 +67,7 @@ public: Callback(Telephony* aTelephony, Promise* aPromise, uint32_t aServiceId, const nsAString& aNumber) - : mTelephony(aTelephony), mPromise(aPromise), mServiceId(aServiceId), - mNumber(aNumber) + : mTelephony(aTelephony), mPromise(aPromise), mServiceId(aServiceId) { MOZ_ASSERT(mTelephony); } @@ -82,9 +80,9 @@ public: } NS_IMETHODIMP - NotifyDialSuccess(uint32_t aCallIndex) + NotifyDialSuccess(uint32_t aCallIndex, const nsAString& aNumber) { - nsRefPtr id = mTelephony->CreateCallId(mNumber); + nsRefPtr id = mTelephony->CreateCallId(aNumber); nsRefPtr call = mTelephony->CreateCall(id, mServiceId, aCallIndex, nsITelephonyService::CALL_STATE_DIALING); diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 0265d32426da..755cefa73f0c 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -530,14 +530,14 @@ TelephonyService.prototype = { } if (!response.isCdma) { - aCallback.notifyDialSuccess(response.callIndex); + aCallback.notifyDialSuccess(response.callIndex, response.number); } else { let currentCallId = Object.keys(this._currentCalls[aClientId])[0]; if (currentCallId === undefined) { - aCallback.notifyDialSuccess(response.callIndex); + aCallback.notifyDialSuccess(response.callIndex, response.number); } else { // RIL doesn't hold the 2nd call. We create one by ourselves. - aCallback.notifyDialSuccess(CDMA_SECOND_CALL_INDEX); + aCallback.notifyDialSuccess(CDMA_SECOND_CALL_INDEX, response.number); this._addCdmaChildCall(aClientId, aNumber, currentCallId); } } diff --git a/dom/telephony/ipc/PTelephonyRequest.ipdl b/dom/telephony/ipc/PTelephonyRequest.ipdl index 1486dd8c6cee..8dba7a3aa825 100644 --- a/dom/telephony/ipc/PTelephonyRequest.ipdl +++ b/dom/telephony/ipc/PTelephonyRequest.ipdl @@ -36,7 +36,7 @@ child: NotifyDialError(nsString aError); - NotifyDialSuccess(uint32_t aCallIndex); + NotifyDialSuccess(uint32_t aCallIndex, nsString aNumber); /** * Sent when the asynchronous request has completed. diff --git a/dom/telephony/ipc/TelephonyChild.cpp b/dom/telephony/ipc/TelephonyChild.cpp index 577c772accc9..392b6de4e7a8 100644 --- a/dom/telephony/ipc/TelephonyChild.cpp +++ b/dom/telephony/ipc/TelephonyChild.cpp @@ -186,10 +186,11 @@ TelephonyRequestChild::RecvNotifyDialError(const nsString& aError) } bool -TelephonyRequestChild::RecvNotifyDialSuccess(const uint32_t& aCallIndex) +TelephonyRequestChild::RecvNotifyDialSuccess(const uint32_t& aCallIndex, + const nsString& aNumber) { MOZ_ASSERT(mCallback); - mCallback->NotifyDialSuccess(aCallIndex); + mCallback->NotifyDialSuccess(aCallIndex, aNumber); return true; } diff --git a/dom/telephony/ipc/TelephonyChild.h b/dom/telephony/ipc/TelephonyChild.h index 88243fbe0586..daa6a70d3480 100644 --- a/dom/telephony/ipc/TelephonyChild.h +++ b/dom/telephony/ipc/TelephonyChild.h @@ -83,7 +83,8 @@ protected: RecvNotifyDialError(const nsString& aError) MOZ_OVERRIDE; virtual bool - RecvNotifyDialSuccess(const uint32_t& aCallIndex) MOZ_OVERRIDE; + RecvNotifyDialSuccess(const uint32_t& aCallIndex, + const nsString& aNumber) MOZ_OVERRIDE; private: nsCOMPtr mListener; diff --git a/dom/telephony/ipc/TelephonyParent.cpp b/dom/telephony/ipc/TelephonyParent.cpp index 7c4a0dfc711b..57626ca360b8 100644 --- a/dom/telephony/ipc/TelephonyParent.cpp +++ b/dom/telephony/ipc/TelephonyParent.cpp @@ -536,10 +536,11 @@ TelephonyRequestParent::NotifyDialError(const nsAString& aError) } NS_IMETHODIMP -TelephonyRequestParent::NotifyDialSuccess(uint32_t aCallIndex) +TelephonyRequestParent::NotifyDialSuccess(uint32_t aCallIndex, + const nsAString& aNumber) { NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); - return (SendNotifyDialSuccess(aCallIndex) && + return (SendNotifyDialSuccess(aCallIndex, nsString(aNumber)) && Send__delete__(this, DialResponse())) ? NS_OK : NS_ERROR_FAILURE; } diff --git a/dom/telephony/nsITelephonyService.idl b/dom/telephony/nsITelephonyService.idl index f6e55a7e6f2b..e8ca89b74d5a 100644 --- a/dom/telephony/nsITelephonyService.idl +++ b/dom/telephony/nsITelephonyService.idl @@ -176,7 +176,7 @@ interface nsITelephonyListener : nsISupports in AString message); }; -[scriptable, uuid(b80a2349-a0d9-4029-8c71-b61fbeb24267)] +[scriptable, uuid(b3b2b0b0-357f-4efb-bc9f-ca2b2d5686a1)] interface nsITelephonyCallback : nsISupports { /** @@ -189,7 +189,7 @@ interface nsITelephonyCallback : nsISupports /** * Called when a dial request succeeds. */ - void notifyDialSuccess(in unsigned long callIndex); + void notifyDialSuccess(in unsigned long callIndex, in AString number); }; %{C++