Bug 1051715 - Part 2: Also pass number in notifyDialSuccess. r=hsinyi

This commit is contained in:
Szu-Yu Chen [:aknow] 2014-08-12 23:51:00 -04:00
Родитель 3a863e7e98
Коммит f5b19b0ff2
7 изменённых файлов: 17 добавлений и 16 удалений

Просмотреть файл

@ -59,7 +59,6 @@ class Telephony::Callback : public nsITelephonyCallback
nsRefPtr<Telephony> mTelephony; nsRefPtr<Telephony> mTelephony;
nsRefPtr<Promise> mPromise; nsRefPtr<Promise> mPromise;
uint32_t mServiceId; uint32_t mServiceId;
nsString mNumber;
virtual ~Callback() {} virtual ~Callback() {}
@ -68,8 +67,7 @@ public:
Callback(Telephony* aTelephony, Promise* aPromise, uint32_t aServiceId, Callback(Telephony* aTelephony, Promise* aPromise, uint32_t aServiceId,
const nsAString& aNumber) const nsAString& aNumber)
: mTelephony(aTelephony), mPromise(aPromise), mServiceId(aServiceId), : mTelephony(aTelephony), mPromise(aPromise), mServiceId(aServiceId)
mNumber(aNumber)
{ {
MOZ_ASSERT(mTelephony); MOZ_ASSERT(mTelephony);
} }
@ -82,9 +80,9 @@ public:
} }
NS_IMETHODIMP NS_IMETHODIMP
NotifyDialSuccess(uint32_t aCallIndex) NotifyDialSuccess(uint32_t aCallIndex, const nsAString& aNumber)
{ {
nsRefPtr<TelephonyCallId> id = mTelephony->CreateCallId(mNumber); nsRefPtr<TelephonyCallId> id = mTelephony->CreateCallId(aNumber);
nsRefPtr<TelephonyCall> call = nsRefPtr<TelephonyCall> call =
mTelephony->CreateCall(id, mServiceId, aCallIndex, mTelephony->CreateCall(id, mServiceId, aCallIndex,
nsITelephonyService::CALL_STATE_DIALING); nsITelephonyService::CALL_STATE_DIALING);

Просмотреть файл

@ -530,14 +530,14 @@ TelephonyService.prototype = {
} }
if (!response.isCdma) { if (!response.isCdma) {
aCallback.notifyDialSuccess(response.callIndex); aCallback.notifyDialSuccess(response.callIndex, response.number);
} else { } else {
let currentCallId = Object.keys(this._currentCalls[aClientId])[0]; let currentCallId = Object.keys(this._currentCalls[aClientId])[0];
if (currentCallId === undefined) { if (currentCallId === undefined) {
aCallback.notifyDialSuccess(response.callIndex); aCallback.notifyDialSuccess(response.callIndex, response.number);
} else { } else {
// RIL doesn't hold the 2nd call. We create one by ourselves. // 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); this._addCdmaChildCall(aClientId, aNumber, currentCallId);
} }
} }

Просмотреть файл

@ -36,7 +36,7 @@ child:
NotifyDialError(nsString aError); NotifyDialError(nsString aError);
NotifyDialSuccess(uint32_t aCallIndex); NotifyDialSuccess(uint32_t aCallIndex, nsString aNumber);
/** /**
* Sent when the asynchronous request has completed. * Sent when the asynchronous request has completed.

Просмотреть файл

@ -186,10 +186,11 @@ TelephonyRequestChild::RecvNotifyDialError(const nsString& aError)
} }
bool bool
TelephonyRequestChild::RecvNotifyDialSuccess(const uint32_t& aCallIndex) TelephonyRequestChild::RecvNotifyDialSuccess(const uint32_t& aCallIndex,
const nsString& aNumber)
{ {
MOZ_ASSERT(mCallback); MOZ_ASSERT(mCallback);
mCallback->NotifyDialSuccess(aCallIndex); mCallback->NotifyDialSuccess(aCallIndex, aNumber);
return true; return true;
} }

Просмотреть файл

@ -83,7 +83,8 @@ protected:
RecvNotifyDialError(const nsString& aError) MOZ_OVERRIDE; RecvNotifyDialError(const nsString& aError) MOZ_OVERRIDE;
virtual bool virtual bool
RecvNotifyDialSuccess(const uint32_t& aCallIndex) MOZ_OVERRIDE; RecvNotifyDialSuccess(const uint32_t& aCallIndex,
const nsString& aNumber) MOZ_OVERRIDE;
private: private:
nsCOMPtr<nsITelephonyListener> mListener; nsCOMPtr<nsITelephonyListener> mListener;

Просмотреть файл

@ -536,10 +536,11 @@ TelephonyRequestParent::NotifyDialError(const nsAString& aError)
} }
NS_IMETHODIMP NS_IMETHODIMP
TelephonyRequestParent::NotifyDialSuccess(uint32_t aCallIndex) TelephonyRequestParent::NotifyDialSuccess(uint32_t aCallIndex,
const nsAString& aNumber)
{ {
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
return (SendNotifyDialSuccess(aCallIndex) && return (SendNotifyDialSuccess(aCallIndex, nsString(aNumber)) &&
Send__delete__(this, DialResponse())) ? NS_OK : NS_ERROR_FAILURE; Send__delete__(this, DialResponse())) ? NS_OK : NS_ERROR_FAILURE;
} }

Просмотреть файл

@ -176,7 +176,7 @@ interface nsITelephonyListener : nsISupports
in AString message); in AString message);
}; };
[scriptable, uuid(b80a2349-a0d9-4029-8c71-b61fbeb24267)] [scriptable, uuid(b3b2b0b0-357f-4efb-bc9f-ca2b2d5686a1)]
interface nsITelephonyCallback : nsISupports interface nsITelephonyCallback : nsISupports
{ {
/** /**
@ -189,7 +189,7 @@ interface nsITelephonyCallback : nsISupports
/** /**
* Called when a dial request succeeds. * Called when a dial request succeeds.
*/ */
void notifyDialSuccess(in unsigned long callIndex); void notifyDialSuccess(in unsigned long callIndex, in AString number);
}; };
%{C++ %{C++