Bug 1115758 - Part 4: Add nsITelephonyService.cancelUSSD (ipc). r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Wed, 07 Jan 2015 15:28:44 +0800
changeset 239163 91470d5fbfde5cb63794ad4e6c8d3a9a87b5cf52
parent 239162 d385fe32e60a1e27d0aabc4410dea51f6901cfe1
child 239164 1e9e14b2eedd6902062beab334c6b98a0f0c0435
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1115758
milestone37.0a1
Bug 1115758 - Part 4: Add nsITelephonyService.cancelUSSD (ipc). r=hsinyi
dom/telephony/ipc/PTelephony.ipdl
dom/telephony/ipc/TelephonyIPCService.cpp
dom/telephony/ipc/TelephonyParent.cpp
--- a/dom/telephony/ipc/PTelephony.ipdl
+++ b/dom/telephony/ipc/PTelephony.ipdl
@@ -19,22 +19,27 @@ struct EnumerateCallsRequest
 
 struct DialRequest
 {
   uint32_t clientId;
   nsString number;
   bool isEmergency;
 };
 
-struct USSDRequest
+struct SendUSSDRequest
 {
   uint32_t clientId;
   nsString ussd;
 };
 
+struct CancelUSSDRequest
+{
+  uint32_t clientId;
+};
+
 struct HangUpConferenceRequest
 {
   uint32_t clientId;
 };
 
 struct AnswerCallRequest
 {
   uint32_t clientId;
@@ -64,17 +69,18 @@ struct ResumeCallRequest
   uint32_t clientId;
   uint32_t callIndex;
 };
 
 union IPCTelephonyRequest
 {
   EnumerateCallsRequest;
   DialRequest;
-  USSDRequest;
+  SendUSSDRequest;
+  CancelUSSDRequest;
   HangUpConferenceRequest;
   AnswerCallRequest;
   HangUpCallRequest;
   RejectCallRequest;
   HoldCallRequest;
   ResumeCallRequest;
 };
 
--- a/dom/telephony/ipc/TelephonyIPCService.cpp
+++ b/dom/telephony/ipc/TelephonyIPCService.cpp
@@ -309,17 +309,24 @@ TelephonyIPCService::StopTone(uint32_t a
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TelephonyIPCService::SendUSSD(uint32_t aClientId, const nsAString& aUssd,
                               nsITelephonyCallback *aCallback)
 {
   return SendRequest(nullptr, aCallback,
-                     USSDRequest(aClientId, nsString(aUssd)));
+                     SendUSSDRequest(aClientId, nsString(aUssd)));
+}
+
+NS_IMETHODIMP
+TelephonyIPCService::CancelUSSD(uint32_t aClientId,
+                                nsITelephonyCallback *aCallback)
+{
+  return SendRequest(nullptr, aCallback, CancelUSSDRequest(aClientId));
 }
 
 NS_IMETHODIMP
 TelephonyIPCService::GetMicrophoneMuted(bool* aMuted)
 {
   if (!mPTelephonyChild) {
     NS_WARNING("TelephonyService used after shutdown has begun!");
     return NS_ERROR_FAILURE;
--- a/dom/telephony/ipc/TelephonyParent.cpp
+++ b/dom/telephony/ipc/TelephonyParent.cpp
@@ -55,22 +55,28 @@ TelephonyParent::RecvPTelephonyRequestCo
 
     case IPCTelephonyRequest::TDialRequest: {
       const DialRequest& request = aRequest.get_DialRequest();
       service->Dial(request.clientId(), request.number(),
                     request.isEmergency(), actor);
       return true;
     }
 
-    case IPCTelephonyRequest::TUSSDRequest: {
-      const USSDRequest& request = aRequest.get_USSDRequest();
+    case IPCTelephonyRequest::TSendUSSDRequest: {
+      const SendUSSDRequest& request = aRequest.get_SendUSSDRequest();
       service->SendUSSD(request.clientId(), request.ussd(), actor);
       return true;
     }
 
+    case IPCTelephonyRequest::TCancelUSSDRequest: {
+      const CancelUSSDRequest& request = aRequest.get_CancelUSSDRequest();
+      service->CancelUSSD(request.clientId(), actor);
+      return true;
+    }
+
     case IPCTelephonyRequest::THangUpConferenceRequest: {
       const HangUpConferenceRequest& request = aRequest.get_HangUpConferenceRequest();
       service->HangUpConference(request.clientId(), actor);
       return true;
     }
 
     case IPCTelephonyRequest::TAnswerCallRequest: {
       const AnswerCallRequest& request = aRequest.get_AnswerCallRequest();