Bug 1114935 - Part 3: Define new IPDL Protocol for nsIIccService. r=echen
authorBevis Tseng <btseng@mozilla.com>
Wed, 07 Jan 2015 14:53:21 +0800
changeset 265017 0e50f55bbd038b83ead01be05bfb5f00f0f629f5
parent 265016 689af3a45b4ea08e4548a5027c9dca8206dd27d5
child 265018 7b20a3e1a9bb45fbadb41983c5c02f94cadcf57f
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1114935
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1114935 - Part 3: Define new IPDL Protocol for nsIIccService. r=echen
dom/icc/ipc/PIcc.ipdl
dom/icc/ipc/PIccRequest.ipdl
dom/icc/ipc/PIccTypes.ipdlh
dom/icc/moz.build
dom/ipc/PContent.ipdl
new file mode 100644
--- /dev/null
+++ b/dom/icc/ipc/PIcc.ipdl
@@ -0,0 +1,111 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+include protocol PContent;
+include protocol PIccRequest;
+include PIccTypes;
+
+using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
+
+namespace mozilla {
+namespace dom {
+namespace icc {
+
+union OptionalIccInfoData
+{
+  void_t;
+  IccInfoData;
+};
+
+struct GetCardLockEnabledRequest
+{
+  uint32_t lockType;
+};
+
+struct UnlockCardLockRequest
+{
+  uint32_t lockType;
+  nsString password;
+  nsString newPin;
+};
+
+struct SetCardLockEnabledRequest
+{
+  uint32_t lockType;
+  nsString password;
+  bool enabled;
+};
+
+struct ChangeCardLockPasswordRequest
+{
+  uint32_t lockType;
+  nsString password;
+  nsString newPassword;
+};
+
+struct GetCardLockRetryCountRequest
+{
+  uint32_t lockType;
+};
+
+struct MatchMvnoRequest
+{
+  uint32_t mvnoType;
+  nsString mvnoData;
+};
+
+struct GetServiceStateEnabledRequest
+{
+  uint32_t service;
+};
+
+union IccRequest
+{
+  GetCardLockEnabledRequest;
+  UnlockCardLockRequest;
+  SetCardLockEnabledRequest;
+  ChangeCardLockPasswordRequest;
+  GetCardLockRetryCountRequest;
+  MatchMvnoRequest;
+  GetServiceStateEnabledRequest;
+};
+
+sync protocol PIcc
+{
+  manager PContent;
+  manages PIccRequest;
+
+child:
+  /**
+   * Notify CardStateChanged with updated CardState.
+   */
+  NotifyCardStateChanged(uint32_t aCardState);
+
+  /**
+   * Notify IccInfoChanged with updated IccInfo.
+   */
+  NotifyIccInfoChanged(OptionalIccInfoData aInfoData);
+
+parent:
+  /**
+   * Sent when the child no longer needs to use PIcc.
+   */
+  __delete__();
+
+  /**
+   * Sent when the child makes an asynchronous request to the parent.
+   */
+  PIccRequest(IccRequest aRequest);
+
+  /**
+   * Sync call to initialize the updated IccInfo/CardState.
+   */
+  sync Init()
+     returns (OptionalIccInfoData aInfoData, uint32_t aCardState);
+
+};
+
+} // namespace icc
+} // namespace dom
+} // namespace mozilla
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/dom/icc/ipc/PIccRequest.ipdl
@@ -0,0 +1,61 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+include protocol PIcc;
+include PIccTypes;
+
+namespace mozilla {
+namespace dom {
+namespace icc {
+
+struct IccReplySuccess
+{
+};
+
+struct IccReplySuccessWithBoolean
+{
+  bool result;
+};
+
+struct IccReplyCardLockRetryCount
+{
+  int32_t count;
+};
+
+struct IccReplyError
+{
+  nsString message;
+};
+
+struct IccReplyCardLockError
+{
+  int32_t retryCount;
+  nsString message;
+};
+
+union IccReply
+{
+  // Success
+  IccReplySuccess;
+  IccReplySuccessWithBoolean;
+  IccReplyCardLockRetryCount;
+  // Error
+  IccReplyError;
+  IccReplyCardLockError;
+};
+
+protocol PIccRequest
+{
+  manager PIcc;
+
+child:
+  /**
+   * Sent when the asynchronous request has completed.
+   */
+  __delete__(IccReply response);
+};
+
+} // namespace icc
+} // namespace dom
+} // namespace mozilla
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/dom/icc/ipc/PIccTypes.ipdlh
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+namespace mozilla {
+namespace dom {
+namespace icc {
+
+struct IccInfoData
+{
+  nsString  iccType;
+  nsString  iccid;
+  nsString  mcc;
+  nsString  mnc;
+  nsString  spn;
+  bool      isDisplayNetworkNameRequired;
+  bool      isDisplaySpnRequired;
+  nsString  phoneNumber;
+  int32_t   prlVersion;
+};
+
+} // namespace icc
+} // namespace dom
+} // namespace mozilla
\ No newline at end of file
--- a/dom/icc/moz.build
+++ b/dom/icc/moz.build
@@ -17,16 +17,22 @@ UNIFIED_SOURCES += [
     'Assertions.cpp',
     'Icc.cpp',
     'IccCardLockError.cpp',
     "IccInfo.cpp",
     'IccListener.cpp',
     'IccManager.cpp',
 ]
 
+IPDL_SOURCES += [
+    'ipc/PIcc.ipdl',
+    'ipc/PIccRequest.ipdl',
+    'ipc/PIccTypes.ipdlh',
+]
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
     EXTRA_JS_MODULES += [
         'gonk/StkProactiveCmdFactory.jsm',
     ]
     EXTRA_COMPONENTS += [
         'gonk/IccService.js',
         'gonk/IccService.manifest',
     ]
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -16,16 +16,17 @@ include protocol PCycleCollectWithLogs;
 include protocol PCrashReporter;
 include protocol PDocAccessible;
 include protocol PExternalHelperApp;
 include protocol PDeviceStorageRequest;
 include protocol PFileDescriptorSet;
 include protocol PFMRadio;
 include protocol PFileSystemRequest;
 include protocol PHal;
+include protocol PIcc;
 include protocol PProcessHangMonitor;
 include protocol PImageBridge;
 include protocol PMemoryReportRequest;
 include protocol PMobileConnection;
 include protocol PNecko;
 include protocol PPluginModule;
 include protocol PPrinting;
 include protocol POfflineCacheUpdate;
@@ -374,16 +375,17 @@ prio(normal upto urgent) sync protocol P
     manages PCycleCollectWithLogs;
     manages PDocAccessible;
     manages PDeviceStorageRequest;
     manages PFileSystemRequest;
     manages PExternalHelperApp;
     manages PFileDescriptorSet;
     manages PFMRadio;
     manages PHal;
+    manages PIcc;
     manages PMemoryReportRequest;
     manages PMobileConnection;
     manages PNecko;
     manages POfflineCacheUpdate;
     manages PPrinting;
     manages PScreenManager;
     manages PSms;
     manages PSpeechSynthesis;
@@ -651,16 +653,18 @@ parent:
 
     async GetSystemMemory(uint64_t getterId);
 
     sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
         returns (bool isSecureURI);
 
     PHal();
 
+    PIcc(uint32_t serviceId);
+
     PMobileConnection(uint32_t clientId);
 
     PNecko();
 
     PPrinting();
 
     prio(high) sync PScreenManager()
         returns (uint32_t numberOfScreens,