зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978639 - Part 4: Add hangUpConference method (ipc). r=hsinyi
This commit is contained in:
Родитель
83fa4d8a67
Коммит
3784c04352
|
@ -30,11 +30,17 @@ struct USSDRequest
|
|||
nsString ussd;
|
||||
};
|
||||
|
||||
struct HangUpConferenceRequest
|
||||
{
|
||||
uint32_t clientId;
|
||||
};
|
||||
|
||||
union IPCTelephonyRequest
|
||||
{
|
||||
EnumerateCallsRequest;
|
||||
DialRequest;
|
||||
USSDRequest;
|
||||
HangUpConferenceRequest;
|
||||
};
|
||||
|
||||
sync protocol PTelephony {
|
||||
|
|
|
@ -253,6 +253,13 @@ TelephonyIPCService::SeparateCall(uint32_t aClientId, uint32_t aCallIndex)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyIPCService::HangUpConference(uint32_t aClientId,
|
||||
nsITelephonyCallback *aCallback)
|
||||
{
|
||||
return SendRequest(nullptr, aCallback, HangUpConferenceRequest(aClientId));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyIPCService::HoldConference(uint32_t aClientId)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,8 @@ TelephonyParent::RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActo
|
|||
return actor->DoRequest(aRequest.get_DialRequest());
|
||||
case IPCTelephonyRequest::TUSSDRequest:
|
||||
return actor->DoRequest(aRequest.get_USSDRequest());
|
||||
case IPCTelephonyRequest::THangUpConferenceRequest:
|
||||
return actor->DoRequest(aRequest.get_HangUpConferenceRequest());
|
||||
default:
|
||||
MOZ_CRASH("Unknown type!");
|
||||
}
|
||||
|
@ -451,6 +453,20 @@ TelephonyRequestParent::DoRequest(const USSDRequest& aRequest)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TelephonyRequestParent::DoRequest(const HangUpConferenceRequest& aRequest)
|
||||
{
|
||||
nsCOMPtr<nsITelephonyService> service =
|
||||
do_GetService(TELEPHONY_SERVICE_CONTRACTID);
|
||||
if (service) {
|
||||
service->HangUpConference(aRequest.clientId(), this);
|
||||
} else {
|
||||
return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError")));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
TelephonyRequestParent::SendResponse(const IPCTelephonyResponse& aResponse)
|
||||
{
|
||||
|
|
|
@ -129,6 +129,9 @@ private:
|
|||
|
||||
bool
|
||||
DoRequest(const USSDRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const HangUpConferenceRequest& aRequest);
|
||||
};
|
||||
|
||||
END_TELEPHONY_NAMESPACE
|
||||
|
|
Загрузка…
Ссылка в новой задаче