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
parent 478cb97c56
commit aad3e91183
7 changed files with 17 additions and 16 deletions

View File

@ -59,7 +59,6 @@ class Telephony::Callback : public nsITelephonyCallback
nsRefPtr<Telephony> mTelephony;
nsRefPtr<Promise> 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<TelephonyCallId> id = mTelephony->CreateCallId(mNumber);
nsRefPtr<TelephonyCallId> id = mTelephony->CreateCallId(aNumber);
nsRefPtr<TelephonyCall> call =
mTelephony->CreateCall(id, mServiceId, aCallIndex,
nsITelephonyService::CALL_STATE_DIALING);

View File

@ -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);
}
}

View File

@ -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.

View File

@ -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;
}

View File

@ -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<nsITelephonyListener> mListener;

View File

@ -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;
}

View File

@ -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++