diff --git a/dom/mobileconnection/gonk/MobileConnectionService.js b/dom/mobileconnection/gonk/MobileConnectionService.js index 2323eac901fb..b88428fe8571 100644 --- a/dom/mobileconnection/gonk/MobileConnectionService.js +++ b/dom/mobileconnection/gonk/MobileConnectionService.js @@ -50,9 +50,9 @@ const kPrefRilDebuggingEnabled = "ril.debugging.enabled"; const INT32_MAX = 2147483647; const UNKNOWN_RSSI = 99; -XPCOMUtils.defineLazyServiceGetter(this, "gMobileConnectionMessenger", - "@mozilla.org/ril/system-messenger-helper;1", - "nsIMobileConnectionMessenger"); +XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger", + "@mozilla.org/system-message-internal;1", + "nsISystemMessagesInternal"); XPCOMUtils.defineLazyServiceGetter(this, "gNetworkManager", "@mozilla.org/network/manager;1", @@ -1153,6 +1153,11 @@ MobileConnectionService.prototype = { } catch (e) {} }, + _broadcastCdmaInfoRecordSystemMessage: function(aMessage) { + // TODO: Bug 1072808, Broadcast System Message with proxy. + gSystemMessenger.broadcastMessage("cdma-info-rec-received", aMessage); + }, + /** * nsIMobileConnectionService interface. */ @@ -1196,8 +1201,6 @@ MobileConnectionService.prototype = { aMessage + " (sessionEnded : " + aSessionEnded + ")"); } - gMobileConnectionMessenger.notifyUssdReceived(aClientId, aMessage, aSessionEnded); - this.getItemByServiceId(aClientId) .deliverListenerEvent("notifyUssdReceived", [aMessage, aSessionEnded]); }, @@ -1365,56 +1368,108 @@ MobileConnectionService.prototype = { }, notifyCdmaInfoRecDisplay: function(aClientId, aDisplay) { - gMobileConnectionMessenger.notifyCdmaInfoRecDisplay(aClientId, aDisplay); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + display: aDisplay + }); }, notifyCdmaInfoRecCalledPartyNumber: function(aClientId, aType, aPlan, aNumber, aPi, aSi) { - gMobileConnectionMessenger - .notifyCdmaInfoRecCalledPartyNumber(aClientId, aType, aPlan, aNumber, - aPi, aSi); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + calledNumber: { + type: aType, + plan: aPlan, + number: aNumber, + pi: aPi, + si: aSi + } + }); }, notifyCdmaInfoRecCallingPartyNumber: function(aClientId, aType, aPlan, aNumber, aPi, aSi) { - gMobileConnectionMessenger - .notifyCdmaInfoRecCallingPartyNumber(aClientId, aType, aPlan, aNumber, - aPi, aSi); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + callingNumber: { + type: aType, + plan: aPlan, + number: aNumber, + pi: aPi, + si: aSi + } + }); }, notifyCdmaInfoRecConnectedPartyNumber: function(aClientId, aType, aPlan, aNumber, aPi, aSi) { - gMobileConnectionMessenger - .notifyCdmaInfoRecConnectedPartyNumber(aClientId, aType, aPlan, aNumber, - aPi, aSi); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + connectedNumber: { + type: aType, + plan: aPlan, + number: aNumber, + pi: aPi, + si: aSi + } + }); }, notifyCdmaInfoRecSignal: function(aClientId, aType, aAlertPitch, aSignal){ - gMobileConnectionMessenger - .notifyCdmaInfoRecSignal(aClientId, aType, aAlertPitch, aSignal); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + signal: { + type: aType, + alertPitch: aAlertPitch, + signal: aSignal + } + }); }, notifyCdmaInfoRecRedirectingNumber: function(aClientId, aType, aPlan, aNumber, aPi, aSi, aReason) { - gMobileConnectionMessenger - .notifyCdmaInfoRecRedirectingNumber(aClientId, aType, aPlan, aNumber, - aPi, aSi, aReason); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + redirect: { + type: aType, + plan: aPlan, + number: aNumber, + pi: aPi, + si: aSi, + reason: aReason + } + }); }, notifyCdmaInfoRecLineControl: function(aClientId, aPolarityIncluded, aToggle, aReverse, aPowerDenial) { - gMobileConnectionMessenger - .notifyCdmaInfoRecLineControl(aClientId, aPolarityIncluded, aToggle, - aReverse, aPowerDenial); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + lineControl: { + polarityIncluded: aPolarityIncluded, + toggle: aToggle, + reverse: aReverse, + powerDenial: aPowerDenial + } + }); }, notifyCdmaInfoRecClir: function(aClientId, aCause) { - gMobileConnectionMessenger.notifyCdmaInfoRecClir(aClientId, aCause); + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + clirCause: aCause + }); }, - notifyCdmaInfoRecAudioControl: function(aClientId, aUpLink, aDownLink) { - gMobileConnectionMessenger - .notifyCdmaInfoRecAudioControl(aClientId, aUpLink, aDownLink); + notifyCdmaInfoRecAudioControl: function(aClientId, aUplink, aDownLink) { + this._broadcastCdmaInfoRecordSystemMessage({ + clientId: aClientId, + audioControl: { + upLink: aUplink, + downLink: aDownLink + } + }); }, /** diff --git a/dom/mobileconnection/gonk/nsIMobileConnectionMessenger.idl b/dom/mobileconnection/gonk/nsIMobileConnectionMessenger.idl deleted file mode 100644 index 7337771a69b2..000000000000 --- a/dom/mobileconnection/gonk/nsIMobileConnectionMessenger.idl +++ /dev/null @@ -1,213 +0,0 @@ -/* 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 "nsISupports.idl" - -[scriptable, uuid(fd2fa95c-5b54-11e4-bc6b-6f3bffb681cd)] -interface nsIMobileConnectionMessenger : nsISupports -{ - /** - * 'ussd-received' system message - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aMessage - * USSD Message to be displayed. - * @param aSessionEnded - * True if USSD session is ended. - */ - void notifyUssdReceived(in unsigned long aServiceId, - in DOMString aMessage, - in boolean aSessionEnded); - - /** - * 'cdma-info-rec-received' system message with Display Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aDisplay - * The text to be displayed. - */ - void notifyCdmaInfoRecDisplay(in unsigned long aServiceId, - in DOMString aDisplay); - - /** - * 'cdma-info-rec-received' system message with Called Party Number Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aTtype - * The type of number. (3-bit binary) - * See Table 2.7.1.3.2.4-2 in 3GPP2 C.S0005-F. - * @param aPlan - * The numbering plan. (4-bit binary) - * See Table 2.7.1.3.2.4-3 in 3GPP2 C.S0005-F. - * @param aNumber - * The string presentation of the number. - * @param aPi (2-bit binary) - * The Presentation indicator of the number. - * See Table 2.7.4.4-1 in 3GPP2 C.S0005-F. - * @param aSi (2-bit binary) - * The Screening Indicator of the number. - * See Table 2.7.4.4-2 in 3GPP2 C.S0005-F. - */ - void notifyCdmaInfoRecCalledPartyNumber(in unsigned long aServiceId, - in unsigned short aType, - in unsigned short aPlan, - in DOMString aNumber, - in unsigned short aPi, - in unsigned short aSi); - - /** - * 'cdma-info-rec-received' system message with Calling Party Number Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aTtype - * The type of number. (3-bit binary) - * See Table 2.7.1.3.2.4-2 in 3GPP2 C.S0005-F. - * @param aPlan - * The numbering plan. (4-bit binary) - * See Table 2.7.1.3.2.4-3 in 3GPP2 C.S0005-F. - * @param aNumber - * The string presentation of the number. - * @param aPi (2-bit binary) - * The Presentation indicator of the number. - * See Table 2.7.4.4-1 in 3GPP2 C.S0005-F. - * @param aSi (2-bit binary) - * The Screening Indicator of the number. - * See Table 2.7.4.4-2 in 3GPP2 C.S0005-F. - */ - void notifyCdmaInfoRecCallingPartyNumber(in unsigned long aServiceId, - in unsigned short aType, - in unsigned short aPlan, - in DOMString aNumber, - in unsigned short aPi, - in unsigned short aSi); - - /** - * 'cdma-info-rec-received' system message with Connected Party Number Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aTtype - * The type of number. (3-bit binary) - * See Table 2.7.1.3.2.4-2 in 3GPP2 C.S0005-F. - * @param aPlan - * The numbering plan. (4-bit binary) - * See Table 2.7.1.3.2.4-3 in 3GPP2 C.S0005-F. - * @param aNumber - * The string presentation of the number. - * @param aPi (2-bit binary) - * The Presentation indicator of the number. - * See Table 2.7.4.4-1 in 3GPP2 C.S0005-F. - * @param aSi (2-bit binary) - * The Screening Indicator of the number. - * See Table 2.7.4.4-2 in 3GPP2 C.S0005-F. - */ - void notifyCdmaInfoRecConnectedPartyNumber(in unsigned long aServiceId, - in unsigned short aType, - in unsigned short aPlan, - in DOMString aNumber, - in unsigned short aPi, - in unsigned short aSi); - - /** - * 'cdma-info-rec-received' system message with Signal Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aType - * The signal type. (2-bit binary) - * See Table 3.7.5.5-1 in 3GPP2 C.S0005-F. - * @param aAlertPitch - * The pitch of the alerting signal. (2-bit binary) - * See Table 3.7.5.5-2 in 3GPP2 C.S0005-F. - * @param aSignal - * The signal code. (6-bit binary) - * See Table 3.7.5.5-3, 3.7.5.5-4, 3.7.5.5-5 in 3GPP2 C.S0005-F. - */ - void notifyCdmaInfoRecSignal(in unsigned long aServiceId, - in unsigned short aType, - in unsigned short aAlertPitch, - in unsigned short aSignal); - - /** - * 'cdma-info-rec-received' system message with Redirecting Number Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aTtype - * The type of number. (3-bit binary) - * See Table 2.7.1.3.2.4-2 in 3GPP2 C.S0005-F. - * @param aPlan - * The numbering plan. (4-bit binary) - * See Table 2.7.1.3.2.4-3 in 3GPP2 C.S0005-F. - * @param aNumber - * The string presentation of the number. - * @param aPi (2-bit binary) - * The Presentation indicator of the number. - * See Table 2.7.4.4-1 in 3GPP2 C.S0005-F. - * @param aSi (2-bit binary) - * The Screening Indicator of the number. - * See Table 2.7.4.4-2 in 3GPP2 C.S0005-F. - * @param aReason (4-bit binary) - * The redirection reason. - * See Table 3.7.5.11-1 in 3GPP2 C.S0005-F. - */ - void notifyCdmaInfoRecRedirectingNumber(in unsigned long aServiceId, - in unsigned short aType, - in unsigned short aPlan, - in DOMString aNumber, - in unsigned short aPi, - in unsigned short aSi, - in unsigned short aReason); - - /** - * 'cdma-info-rec-received' system message with Line Control Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aPolarityIncluded (1-bit) - * Polarity parameter included. - * @param aToggle (1-bit) - * Toggle mode. - * @param aReverse (1-bit) - * Reverse polarity. - * @param aPowerDenial (8-bit) - * Power denial timeout. - */ - void notifyCdmaInfoRecLineControl(in unsigned long aServiceId, - in unsigned short aPolarityIncluded, - in unsigned short aToggle, - in unsigned short aReverse, - in unsigned short aPowerDenial); - - /** - * 'cdma-info-rec-received' system message with CLIR Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aCause - * Reason code. (8-bit binary) - * See Table A 1.1-1 in T53. - * - * See 'ANNEX 1 Country-Specific Record Type for Japan' in T53. - * http://www.arib.or.jp/english/html/overview/doc/T53v6_5_pdf/5_ANNEX_v6_5.pdf - */ - void notifyCdmaInfoRecClir(in unsigned long aServiceId, - in unsigned short aCause); - - /** - * 'cdma-info-rec-received' system message with Audio Control Info - * - * @param aServiceId - * The ID of Service where this info is notified from. - * @param aUpLink - * @param aDownLink - */ - void notifyCdmaInfoRecAudioControl(in unsigned long aServiceId, - in short aUpLink, - in short aDownLink); -}; diff --git a/dom/mobileconnection/moz.build b/dom/mobileconnection/moz.build index 659ac14536a0..98307a6c67e9 100644 --- a/dom/mobileconnection/moz.build +++ b/dom/mobileconnection/moz.build @@ -62,7 +62,6 @@ IPDL_SOURCES += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: XPIDL_SOURCES += [ 'gonk/nsIGonkMobileConnectionService.idl', - 'gonk/nsIMobileConnectionMessenger.idl', ] EXTRA_COMPONENTS += [ 'gonk/MobileConnectionService.js', diff --git a/dom/system/gonk/RILSystemMessenger.jsm b/dom/system/gonk/RILSystemMessenger.jsm index 588b8bb55091..73cefec8584c 100644 --- a/dom/system/gonk/RILSystemMessenger.jsm +++ b/dom/system/gonk/RILSystemMessenger.jsm @@ -155,153 +155,6 @@ RILSystemMessenger.prototype = { } this.broadcastMessage("cellbroadcast-received", data); - }, - - /** - * Wrapper to send 'ussd-received' system message. - */ - notifyUssdReceived: function(aServiceId, aMessage, aSessionEnded) { - this.broadcastMessage("ussd-received", { - serviceId: aServiceId, - message: aMessage, - sessionEnded: aSessionEnded - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Display Info. - */ - notifyCdmaInfoRecDisplay: function(aServiceId, aDisplay) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - display: aDisplay - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Called Party - * Number Info. - */ - notifyCdmaInfoRecCalledPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - calledNumber: { - type: aType, - plan: aPlan, - number: aNumber, - pi: aPi, - si: aSi - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Calling Party - * Number Info. - */ - notifyCdmaInfoRecCallingPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - callingNumber: { - type: aType, - plan: aPlan, - number: aNumber, - pi: aPi, - si: aSi - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Connected Party - * Number Info. - */ - notifyCdmaInfoRecConnectedPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - connectedNumber: { - type: aType, - plan: aPlan, - number: aNumber, - pi: aPi, - si: aSi - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Signal Info. - */ - notifyCdmaInfoRecSignal: function(aServiceId, aType, aAlertPitch, aSignal) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - signal: { - type: aType, - alertPitch: aAlertPitch, - signal: aSignal - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Redirecting - * Number Info. - */ - notifyCdmaInfoRecRedirectingNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi, aReason) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - redirect: { - type: aType, - plan: aPlan, - number: aNumber, - pi: aPi, - si: aSi, - reason: aReason - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Line Control Info. - */ - notifyCdmaInfoRecLineControl: function(aServiceId, aPolarityIncluded, - aToggle, aReverse, aPowerDenial) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - lineControl: { - polarityIncluded: aPolarityIncluded, - toggle: aToggle, - reverse: aReverse, - powerDenial: aPowerDenial - } - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with CLIR Info. - */ - notifyCdmaInfoRecClir: function(aServiceId, aCause) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - clirCause: aCause - }); - }, - - /** - * Wrapper to send 'cdma-info-rec-received' system message with Audio Control Info. - */ - notifyCdmaInfoRecAudioControl: function(aServiceId, aUpLink, aDownLink) { - this.broadcastMessage("cdma-info-rec-received", { - clientId: aServiceId, - audioControl: { - upLink: aUpLink, - downLink: aDownLink - } - }); } }; diff --git a/dom/system/gonk/RILSystemMessengerHelper.js b/dom/system/gonk/RILSystemMessengerHelper.js index e47d3734c7bf..40cb78ce1908 100644 --- a/dom/system/gonk/RILSystemMessengerHelper.js +++ b/dom/system/gonk/RILSystemMessengerHelper.js @@ -51,8 +51,7 @@ RILSystemMessengerHelper.prototype = { classID: RILSYSTEMMESSENGERHELPER_CID, QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyMessenger, Ci.nsISmsMessenger, - Ci.nsICellbroadcastMessenger, - Ci.nsIMobileConnectionMessenger]), + Ci.nsICellbroadcastMessenger]), /** * RILSystemMessenger instance. @@ -94,60 +93,7 @@ RILSystemMessengerHelper.prototype = { aMessageId, aLanguage, aBody, aMessageClass, aTimestamp, aCdmaServiceCategory, aHasEtwsInfo, aEtwsWarningType, aEtwsEmergencyUserAlert, aEtwsPopup); - }, - - /** - * nsIMobileConnectionMessenger API - */ - notifyUssdReceived: function(aServiceId, aMessage, aSessionEnded) { - this.messenger.notifyUssdReceived(aServiceId, aMessage, aSessionEnded); - }, - - notifyCdmaInfoRecDisplay: function(aServiceId, aDisplay) { - this.messenger.notifyCdmaInfoRecDisplay(aServiceId, aDisplay); - }, - - notifyCdmaInfoRecCalledPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.messenger.notifyCdmaInfoRecCalledPartyNumber(aServiceId, aType, aPlan, - aNumber, aPi, aSi); - }, - - notifyCdmaInfoRecCallingPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.messenger.notifyCdmaInfoRecCallingPartyNumber(aServiceId, aType, aPlan, - aNumber, aPi, aSi); - }, - - notifyCdmaInfoRecConnectedPartyNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi) { - this.messenger.notifyCdmaInfoRecConnectedPartyNumber(aServiceId, aType, aPlan, - aNumber, aPi, aSi); - }, - - notifyCdmaInfoRecSignal: function(aServiceId, aType, aAlertPitch, aSignal) { - this.messenger.notifyCdmaInfoRecSignal(aServiceId, aType, aAlertPitch, aSignal); - }, - - notifyCdmaInfoRecRedirectingNumber: function(aServiceId, aType, aPlan, - aNumber, aPi, aSi, aReason) { - this.messenger.notifyCdmaInfoRecRedirectingNumber(aServiceId, aType, aPlan, - aNumber, aPi, aSi, aReason); - }, - - notifyCdmaInfoRecLineControl: function(aServiceId, aPolarityIncluded, - aToggle, aReverse, aPowerDenial) { - this.messenger.notifyCdmaInfoRecLineControl(aServiceId, aPolarityIncluded, - aToggle, aReverse, aPowerDenial); - }, - - notifyCdmaInfoRecClir: function(aServiceId, aCause) { - this.messenger.notifyCdmaInfoRecClir(aServiceId, aCause); - }, - - notifyCdmaInfoRecAudioControl: function(aServiceId, aUpLink, aDownLink) { - this.messenger.notifyCdmaInfoRecAudioControl(aServiceId, aUpLink, aDownLink); } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILSystemMessengerHelper]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILSystemMessengerHelper]); \ No newline at end of file diff --git a/dom/system/gonk/tests/test_ril_system_messenger.js b/dom/system/gonk/tests/test_ril_system_messenger.js index 7680a901ef11..104be1a40e44 100644 --- a/dom/system/gonk/tests/test_ril_system_messenger.js +++ b/dom/system/gonk/tests/test_ril_system_messenger.js @@ -54,13 +54,9 @@ function run_test() { let cellbroadcastMessenger = Cc["@mozilla.org/ril/system-messenger-helper;1"] .getService(Ci.nsICellbroadcastMessenger); - let mobileConnectionMessenger = Cc["@mozilla.org/ril/system-messenger-helper;1"] - .getService(Ci.nsIMobileConnectionMessenger); - ok(telephonyMessenger !== null, "Get TelephonyMessenger."); ok(smsMessenger != null, "Get SmsMessenger."); ok(cellbroadcastMessenger != null, "Get CellbroadcastMessenger."); - ok(mobileConnectionMessenger != null, "Get MobileConnectionMessenger."); run_next_test(); } @@ -377,137 +373,3 @@ add_test(function test_cellbroadcast_messenger_notify_cb_message_received() { run_next_test(); }); - -/** - * Verify RILSystemMessenger.notifyUssdReceived() - */ -add_test(function test_mobileconnection_notify_ussd_received() { - let messenger = newRILSystemMessenger(); - - messenger.notifyUssdReceived(0, "USSD Message", false); - - equal_received_system_message("ussd-received", { - serviceId: 0, - message: "USSD Message", - sessionEnded: false - }); - - messenger.notifyUssdReceived(1, "USSD Message", true); - - equal_received_system_message("ussd-received", { - serviceId: 1, - message: "USSD Message", - sessionEnded: true - }); - - run_next_test(); -}); - -/** - * Verify RILSystemMessenger.notifyCdmaInfoRecXXX() - */ -add_test(function test_mobileconnection_notify_cdma_info() { - let messenger = newRILSystemMessenger(); - - messenger.notifyCdmaInfoRecDisplay(0, "CDMA Display Info"); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 0, - display: "CDMA Display Info" - }); - - messenger.notifyCdmaInfoRecCalledPartyNumber(1, 1, 2, "+0987654321", 3, 4); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 1, - calledNumber: { - type: 1, - plan: 2, - number: "+0987654321", - pi: 3, - si: 4 - } - }); - - messenger.notifyCdmaInfoRecCallingPartyNumber(0, 5, 6, "+1234567890", 7, 8); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 0, - callingNumber: { - type: 5, - plan: 6, - number: "+1234567890", - pi: 7, - si: 8 - } - }); - - messenger.notifyCdmaInfoRecConnectedPartyNumber(1, 4, 3, "+56473839201", 2, 1); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 1, - connectedNumber: { - type: 4, - plan: 3, - number: "+56473839201", - pi: 2, - si: 1 - } - }); - - messenger.notifyCdmaInfoRecSignal(0, 1, 2, 3); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 0, - signal: { - type: 1, - alertPitch: 2, - signal: 3 - } - }); - - messenger.notifyCdmaInfoRecRedirectingNumber(1, 8, 7, "+1029384756", 6, 5, 4); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 1, - redirect: { - type: 8, - plan: 7, - number: "+1029384756", - pi: 6, - si: 5, - reason: 4 - } - }); - - messenger.notifyCdmaInfoRecLineControl(0, 1, 0, 1, 255); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 0, - lineControl: { - polarityIncluded: 1, - toggle: 0, - reverse: 1, - powerDenial: 255 - } - }); - - messenger.notifyCdmaInfoRecClir(1, 256); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 1, - clirCause: 256 - }); - - messenger.notifyCdmaInfoRecAudioControl(0, 255, -1); - - equal_received_system_message("cdma-info-rec-received", { - clientId: 0, - audioControl: { - upLink: 255, - downLink: -1 - } - }); - - run_next_test(); -}); diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index e2c62c94f052..8e854d13421c 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -1272,6 +1272,14 @@ TelephonyService.prototype = { aMessage + " (sessionEnded : " + aSessionEnded + ")"); } + let info = { + serviceId: aClientId, + message: aMessage, + sessionEnded: aSessionEnded + }; + + gSystemMessenger.broadcastMessage("ussd-received", info); + gGonkMobileConnectionService.notifyUssdReceived(aClientId, aMessage, aSessionEnded); },