зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1051715 - Part 2: Also pass number in notifyDialSuccess. r=hsinyi
This commit is contained in:
Родитель
3a863e7e98
Коммит
f5b19b0ff2
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++
|
||||
|
|
Загрузка…
Ссылка в новой задаче