Bug 822210 - cdma call waiting - part2 - telephony DOM. r=bent

This commit is contained in:
Hsin-Yi Tsai 2013-07-30 17:08:53 +08:00
parent b6a3c06681
commit 09536b0fc3
2 changed files with 25 additions and 0 deletions

View File

@ -552,6 +552,18 @@ Telephony::NotifyError(int32_t aCallIndex,
return NS_OK;
}
NS_IMETHODIMP
Telephony::NotifyCdmaCallWaiting(const nsAString& aNumber)
{
MOZ_ASSERT(mActiveCall &&
mActiveCall->CallState() == nsITelephonyProvider::CALL_STATE_CONNECTED);
nsRefPtr<TelephonyCall> callToNotify = mActiveCall;
callToNotify->UpdateSecondNumber(aNumber);
DispatchCallEvent(NS_LITERAL_STRING("callschanged"), callToNotify);
return NS_OK;
}
nsresult
Telephony::DispatchCallEvent(const nsAString& aType,
TelephonyCall* aCall)

View File

@ -20,6 +20,7 @@ class TelephonyCall MOZ_FINAL : public nsDOMEventTargetHelper
nsRefPtr<Telephony> mTelephony;
nsString mNumber;
nsString mSecondNumber;
nsString mState;
bool mEmergency;
nsRefPtr<mozilla::dom::DOMError> mError;
@ -52,6 +53,12 @@ public:
aNumber.Assign(mNumber);
}
void
GetSecondNumber(nsString& aSecondNumber) const
{
aSecondNumber.Assign(mSecondNumber);
}
void
GetState(nsString& aState) const
{
@ -128,6 +135,12 @@ public:
mEmergency = aEmergency;
}
void
UpdateSecondNumber(const nsAString& aNumber)
{
mSecondNumber = aNumber;
}
bool
IsOutgoing() const
{