From c365bb03ce475e769b6ea0448244c377ff17ad8c Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Wed, 7 Jan 2015 14:53:21 +0800 Subject: [PATCH] Bug 1114935 - Part 3: Define new IPDL Protocol for nsIIccService. r=echen --- dom/icc/ipc/PIcc.ipdl | 111 +++++++++++++++++++++++++++++++++++ dom/icc/ipc/PIccRequest.ipdl | 61 +++++++++++++++++++ dom/icc/ipc/PIccTypes.ipdlh | 24 ++++++++ dom/icc/moz.build | 6 ++ dom/ipc/PContent.ipdl | 4 ++ 5 files changed, 206 insertions(+) create mode 100644 dom/icc/ipc/PIcc.ipdl create mode 100644 dom/icc/ipc/PIccRequest.ipdl create mode 100644 dom/icc/ipc/PIccTypes.ipdlh diff --git a/dom/icc/ipc/PIcc.ipdl b/dom/icc/ipc/PIcc.ipdl new file mode 100644 index 00000000000..88edc2b17fd --- /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 diff --git a/dom/icc/ipc/PIccRequest.ipdl b/dom/icc/ipc/PIccRequest.ipdl new file mode 100644 index 00000000000..afe2c386491 --- /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 diff --git a/dom/icc/ipc/PIccTypes.ipdlh b/dom/icc/ipc/PIccTypes.ipdlh new file mode 100644 index 00000000000..1a463f8ebc5 --- /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 diff --git a/dom/icc/moz.build b/dom/icc/moz.build index 709a7eae37b..68021f067a2 100644 --- a/dom/icc/moz.build +++ b/dom/icc/moz.build @@ -22,6 +22,12 @@ UNIFIED_SOURCES += [ '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', diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 26354d71fae..3528b1359c9 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -21,6 +21,7 @@ include protocol PFileDescriptorSet; include protocol PFMRadio; include protocol PFileSystemRequest; include protocol PHal; +include protocol PIcc; include protocol PProcessHangMonitor; include protocol PImageBridge; include protocol PMemoryReportRequest; @@ -379,6 +380,7 @@ prio(normal upto urgent) sync protocol PContent manages PFileDescriptorSet; manages PFMRadio; manages PHal; + manages PIcc; manages PMemoryReportRequest; manages PMobileConnection; manages PNecko; @@ -656,6 +658,8 @@ parent: PHal(); + PIcc(uint32_t serviceId); + PMobileConnection(uint32_t clientId); PNecko();