From 41a34c30b6b2a322794f9b37ef59e249319df078 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Wed, 6 Nov 2013 00:00:24 -0800 Subject: [PATCH 01/15] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/8b613bca5524 Author: Ian Liu Desc: Merge pull request #13414 from ian-liu/system/Bug907825_Floating_pixels_above_checkmarks_on_value_selector_screen Bug 907825 - [System] [HD] Floating pixels above checkmarks on value selector screen, r=@RudyLu ======== https://hg.mozilla.org/integration/gaia-central/rev/24c3d1b939a2 Author: ian-liu Desc: Bug 907825 - [System] [HD] Floating pixels above checkmarks on value selector screen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 43bf0724e46..e785246b791 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "5cc807be4ece02c364c1d7f1cd2becbe1a1b441e", + "revision": "8b613bca552487199ee0f9ecebe43fa854387a88", "repo_path": "/integration/gaia-central" } From 1ed918e4dc2b7c0d54eb046fb350fd0a436989cd Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Mon, 4 Nov 2013 16:39:27 +0800 Subject: [PATCH 02/15] Bug 930918 - Don't expose CDMA MIN due to security concern. r=allstars.chh,hsinyi --- dom/icc/interfaces/nsIDOMIccInfo.idl | 7 +------ dom/system/gonk/RILContentHelper.js | 3 +-- dom/system/gonk/RadioInterfaceLayer.js | 3 +-- dom/system/gonk/ril_worker.js | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/dom/icc/interfaces/nsIDOMIccInfo.idl b/dom/icc/interfaces/nsIDOMIccInfo.idl index 3a04fc95043..ecf8f544165 100644 --- a/dom/icc/interfaces/nsIDOMIccInfo.idl +++ b/dom/icc/interfaces/nsIDOMIccInfo.idl @@ -55,16 +55,11 @@ interface nsIDOMMozGsmIccInfo : nsIDOMMozIccInfo readonly attribute DOMString msisdn; }; -[scriptable, uuid(013e973e-8b56-4525-b634-d23166b86edb)] +[scriptable, uuid(10b89660-2988-443a-a6f0-4ed3618fee41)] interface nsIDOMMozCdmaIccInfo : nsIDOMMozIccInfo { /** * Mobile Directory Number (MDN) of the subscriber, aka his phone number. */ readonly attribute DOMString mdn; - - /** - * Mobile Identification Number (MIN) of the subscriber. - */ - readonly attribute DOMString min; }; diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index 9441a518de7..5502c0cca9b 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -189,8 +189,7 @@ CdmaIccInfo.prototype = { // nsIDOMMozCdmaIccInfo - mdn: null, - min: null + mdn: null }; function VoicemailInfo() {} diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 25db90bad98..6b5a3bbc77c 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -527,8 +527,7 @@ CdmaIccInfo.prototype = { // nsIDOMMozCdmaIccInfo - mdn: null, - min: null + mdn: null }; function RadioInterfaceLayer() { diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index c06d7eda50f..8221688f863 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -5893,7 +5893,7 @@ RIL[REQUEST_CDMA_SUBSCRIPTION] = function REQUEST_CDMA_SUBSCRIPTION(length, opti this.iccInfo.mdn = result[0]; // The result[1] is Home SID. (Already be handled in readCDMAHome()) // The result[2] is Home NID. (Already be handled in readCDMAHome()) - this.iccInfo.min = result[3]; + // The result[3] is MIN. // The result[4] is PRL version. ICCUtilsHelper.handleICCInfoChange(); From d04d2debc1039a57d92fcbee9be0ad455956ca59 Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Wed, 30 Oct 2013 15:24:17 +0800 Subject: [PATCH 03/15] Bug 913313 - [wasabi][CDMA] There is no tick icon next to the message sent after enabling "Delivery reports". r=gene --- dom/system/gonk/ril_consts.js | 16 ++-- dom/system/gonk/ril_worker.js | 152 +++++++++++++++++++++++++++------- 2 files changed, 133 insertions(+), 35 deletions(-) diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index c5e3789ab60..4d59ce86a48 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -2772,16 +2772,18 @@ this.PDU_CDMA_MSG_CODING_7BITS_GSM = 0x09; // GSM 7-bit default alphabet(7-bi this.PDU_CDMA_MSG_CODING_GSM_DCS = 0x0A; // GSM Data-Coding-Scheme, Not supported // SMS Message Type, as defined in 3GPP2 C.S0015-A v2.0, Table 4.5.1-1 -this.PDU_CDMA_MSG_TYPE_DELIVER = 0x01; // Receive -this.PDU_CDMA_MSG_TYPE_SUBMIT = 0x02; // Send +this.PDU_CDMA_MSG_TYPE_DELIVER = 0x01; // Deliver +this.PDU_CDMA_MSG_TYPE_SUBMIT = 0x02; // Submit +this.PDU_CDMA_MSG_TYPE_DELIVER_ACK = 0x04; // Delivery Acknowledgment // SMS User Data Subparameters, as defined in 3GPP2 C.S0015-A v2.0, Table 4.5-1 -this.PDU_CDMA_MSG_USERDATA_MSG_ID = 0x00; // Message Identifier -this.PDU_CDMA_MSG_USERDATA_BODY = 0x01; // User Data Body -this.PDU_CDMA_MSG_USERDATA_TIMESTAMP = 0x03; // Message Center Time Stamp -this.PDU_CDMA_REPLY_OPTION = 0x0A; // Reply Option -this.PDU_CDMA_LANGUAGE_INDICATOR = 0x0D; // Language Indicator +this.PDU_CDMA_MSG_USERDATA_MSG_ID = 0x00; // Message Identifier +this.PDU_CDMA_MSG_USERDATA_BODY = 0x01; // User Data Body +this.PDU_CDMA_MSG_USERDATA_TIMESTAMP = 0x03; // Message Center Time Stamp +this.PDU_CDMA_MSG_USERDATA_REPLY_OPTION = 0x0A; // Reply Option +this.PDU_CDMA_LANGUAGE_INDICATOR = 0x0D; // Language Indicator this.PDU_CDMA_MSG_USERDATA_CALLBACK_NUMBER = 0x0E; // Callback Number +this.PDU_CDMA_MSG_USER_DATA_MSG_STATUS = 0x14; // Message Status // CDMA Language Indicator: Language groups // see 3GPP2 C.R1001-F table 9.2-1 diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 8221688f863..ac321a08d47 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -4306,6 +4306,46 @@ let RIL = { return PDU_FCS_OK; }, + /** + * Helper for processing CDMA SMS Delivery Acknowledgment Message + * + * @param message + * decoded SMS Delivery ACK message from CdmaPDUHelper. + * + * @return A failure cause defined in 3GPP 23.040 clause 9.2.3.22. + */ + _processCdmaSmsStatusReport: function _processCdmaSmsStatusReport(message) { + let options = this._pendingSentSmsMap[message.msgId]; + if (!options) { + if (DEBUG) debug("no pending SMS-SUBMIT message"); + return PDU_FCS_OK; + } + + if (message.errorClass === 2) { + if (DEBUG) debug("SMS-STATUS-REPORT: delivery still pending, msgStatus: " + message.msgStatus); + return PDU_FCS_OK; + } + + delete this._pendingSentSmsMap[message.msgId]; + + if (message.errorClass === -1 && message.body) { + // Process as normal incoming SMS, if errorClass is invalid + // but message body is available. + return this._processSmsMultipart(message); + } + + let deliveryStatus = (message.errorClass === 0) + ? GECKO_SMS_DELIVERY_STATUS_SUCCESS + : GECKO_SMS_DELIVERY_STATUS_ERROR; + this.sendChromeMessage({ + rilMessageType: options.rilMessageType, + rilMessageToken: options.rilMessageToken, + deliveryStatus: deliveryStatus + }); + + return PDU_FCS_OK; + }, + /** * Helper for processing received multipart SMS. * @@ -6206,7 +6246,11 @@ RIL[UNSOLICITED_RESPONSE_CDMA_NEW_SMS] = function UNSOLICITED_RESPONSE_CDMA_NEW_ let [message, result] = CdmaPDUHelper.processReceivedSms(length); if (message) { - result = this._processSmsMultipart(message); + if (message.subMsgType === PDU_CDMA_MSG_TYPE_DELIVER_ACK) { + result = this._processCdmaSmsStatusReport(message); + } else { + result = this._processSmsMultipart(message); + } } if (result == PDU_FCS_RESERVED || result == MOZ_FCS_WAIT_FOR_EXPLICIT_ACK) { @@ -8667,6 +8711,9 @@ let CdmaPDUHelper = { // User Data this.encodeUserDataMsg(options); + // Reply Option + this.encodeUserDataReplyOption(options); + return userDataBuffer; }, @@ -8791,6 +8838,21 @@ let CdmaPDUHelper = { BitBufferHelper.overwriteWriteBuffer(lengthPosition - 1, [currentPosition - lengthPosition]); }, + /** + * User data subparameter encoder : Reply Option + * + * @see 3GGP2 C.S0015-B 2.0, 4.5.11 Reply Option + */ + encodeUserDataReplyOption: function cdma_encodeUserDataReplyOption(options) { + if (options.requestStatusReport) { + BitBufferHelper.writeBits(PDU_CDMA_MSG_USERDATA_REPLY_OPTION, 8); + BitBufferHelper.writeBits(1, 8); + BitBufferHelper.writeBits(0, 1); // USER_ACK_REQ + BitBufferHelper.writeBits(1, 1); // DAK_REQ + BitBufferHelper.flushWithPadding(); + } + }, + /** * Entry point for SMS decoding, the returned object is made compatible * with existing readMessage() of GsmPDUHelper @@ -8838,39 +8900,56 @@ let CdmaPDUHelper = { message.sender += String.fromCharCode(addrDigit); } - // User Data + // Bearer Data this.decodeUserData(message); + // Bearer Data Sub-Parameter: User Data + let userData = message[PDU_CDMA_MSG_USERDATA_BODY]; + [message.header, message.body, message.encoding] = + (userData)? [userData.header, userData.body, userData.encoding] + : [null, null, null]; + + // Bearer Data Sub-Parameter: Message Status + // Success Delivery (0) if both Message Status and User Data are absent. + // Message Status absent (-1) if only User Data is available. + let msgStatus = message[PDU_CDMA_MSG_USER_DATA_MSG_STATUS]; + [message.errorClass, message.msgStatus] = + (msgStatus)? [msgStatus.errorClass, msgStatus.msgStatus] + : ((message.body)? [-1, -1]: [0, 0]); + // Transform message to GSM msg let msg = { - SMSC: "", - mti: 0, - udhi: 0, - sender: message.sender, - recipient: null, - pid: PDU_PID_DEFAULT, - epid: PDU_PID_DEFAULT, - dcs: 0, - mwi: null, //message[PDU_CDMA_MSG_USERDATA_BODY].header ? message[PDU_CDMA_MSG_USERDATA_BODY].header.mwi : null, - replace: false, - header: message[PDU_CDMA_MSG_USERDATA_BODY].header, - body: message[PDU_CDMA_MSG_USERDATA_BODY].body, - data: null, - timestamp: message[PDU_CDMA_MSG_USERDATA_TIMESTAMP], - language: message[PDU_CDMA_LANGUAGE_INDICATOR], - status: null, - scts: null, - dt: null, - encoding: message[PDU_CDMA_MSG_USERDATA_BODY].encoding, - messageClass: GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL], - messageType: message.messageType, - serviceCategory: message.service + SMSC: "", + mti: 0, + udhi: 0, + sender: message.sender, + recipient: null, + pid: PDU_PID_DEFAULT, + epid: PDU_PID_DEFAULT, + dcs: 0, + mwi: null, + replace: false, + header: message.header, + body: message.body, + data: null, + timestamp: message[PDU_CDMA_MSG_USERDATA_TIMESTAMP], + language: message[PDU_CDMA_LANGUAGE_INDICATOR], + status: null, + scts: null, + dt: null, + encoding: message.encoding, + messageClass: GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL], + messageType: message.messageType, + serviceCategory: message.service, + subMsgType: message[PDU_CDMA_MSG_USERDATA_MSG_ID].msgType, + msgId: message[PDU_CDMA_MSG_USERDATA_MSG_ID].msgId, + errorClass: message.errorClass, + msgStatus: message.msgStatus }; return msg; }, - /** * Helper for processing received SMS parcel data. * @@ -8963,8 +9042,8 @@ let CdmaPDUHelper = { case PDU_CDMA_MSG_USERDATA_TIMESTAMP: message[id] = this.decodeUserDataTimestamp(); break; - case PDU_CDMA_REPLY_OPTION: - message[id] = this.decodeUserDataReplyAction(); + case PDU_CDMA_MSG_USERDATA_REPLY_OPTION: + message[id] = this.decodeUserDataReplyOption(); break; case PDU_CDMA_LANGUAGE_INDICATOR: message[id] = this.decodeLanguageIndicator(); @@ -8972,6 +9051,9 @@ let CdmaPDUHelper = { case PDU_CDMA_MSG_USERDATA_CALLBACK_NUMBER: message[id] = this.decodeUserDataCallbackNumber(); break; + case PDU_CDMA_MSG_USER_DATA_MSG_STATUS: + message[id] = this.decodeUserDataMsgStatus(); + break; } userDataLength -= (length + 2); @@ -9338,7 +9420,7 @@ let CdmaPDUHelper = { * * @see 3GGP2 C.S0015-B 2.0, 4.5.11 Reply Option */ - decodeUserDataReplyAction: function cdma_decodeUserDataReplyAction() { + decodeUserDataReplyOption: function cdma_decodeUserDataReplyOption() { let replyAction = BitBufferHelper.readBits(4), result = { userAck: (replyAction & 0x8) ? true : false, deliverAck: (replyAction & 0x4) ? true : false, @@ -9386,6 +9468,20 @@ let CdmaPDUHelper = { return result; }, + /** + * User data subparameter decoder : Message Status + * + * @see 3GGP2 C.S0015-B 2.0, 4.5.21 Message Status + */ + decodeUserDataMsgStatus: function cdma_decodeUserDataMsgStatus() { + let result = { + errorClass: BitBufferHelper.readBits(2), + msgStatus: BitBufferHelper.readBits(6) + }; + + return result; + }, + /** * Decode information record parcel. */ From 0b9e45a6617da12d763d2c9b48042f33ec915200 Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Mon, 4 Nov 2013 09:59:12 +0800 Subject: [PATCH 04/15] Bug 913313: Part 2, Add Unit Test to verify the parsing of CDMA SMS Delivery Report and the flag of enabling Delivery Report. r=gene --- .../gonk/tests/test_ril_worker_sms_cdma.js | 100 ++++++++++++++++++ .../test_ril_worker_sms_cdmapduhelper.js | 73 +++++++++++++ dom/system/gonk/tests/xpcshell.ini | 2 + 3 files changed, 175 insertions(+) create mode 100644 dom/system/gonk/tests/test_ril_worker_sms_cdma.js create mode 100644 dom/system/gonk/tests/test_ril_worker_sms_cdmapduhelper.js diff --git a/dom/system/gonk/tests/test_ril_worker_sms_cdma.js b/dom/system/gonk/tests/test_ril_worker_sms_cdma.js new file mode 100644 index 00000000000..920ba05404b --- /dev/null +++ b/dom/system/gonk/tests/test_ril_worker_sms_cdma.js @@ -0,0 +1,100 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this); + +function run_test() { + run_next_test(); +} + +function _getWorker() { + let _postedMessage; + let _worker = newWorker({ + postRILMessage: function fakePostRILMessage(data) { + }, + postMessage: function fakePostMessage(message) { + _postedMessage = message; + } + }); + return { + get postedMessage() { + return _postedMessage; + }, + get worker() { + return _worker; + } + }; +} + +/** + * Verify CDMA SMS Delivery ACK Message. + */ +add_test(function test_processCdmaSmsStatusReport() { + let workerHelper = _getWorker(); + let worker = workerHelper.worker; + + function test_StatusReport(errorClass, msgStatus) { + let msgId = 0; + let sentSmsMap = worker.RIL._pendingSentSmsMap; + + sentSmsMap[msgId] = {}; + + let message = { + SMSC: "", + mti: 0, + udhi: 0, + sender: "0987654321", + recipient: null, + pid: PDU_PID_DEFAULT, + epid: PDU_PID_DEFAULT, + dcs: 0, + mwi: null, + replace: false, + header: null, + body: "Status: Sent, Dest: 0987654321", + data: null, + timestamp: new Date().valueOf(), + language: null, + status: null, + scts: null, + dt: null, + encoding: PDU_CDMA_MSG_CODING_7BITS_ASCII, + messageClass: GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL], + messageType: PDU_CDMA_MSG_TYPE_P2P, + serviceCategory: 0, + subMsgType: PDU_CDMA_MSG_TYPE_DELIVER_ACK, + msgId: msgId, + errorClass: errorClass, + msgStatus: msgStatus + }; + + worker.RIL._processCdmaSmsStatusReport(message); + + let postedMessage = workerHelper.postedMessage; + + // Check if pending token is removed. + do_check_true((errorClass === 2)? !!sentSmsMap[msgId]: !sentSmsMap[msgId]); + + // Check the response message accordingly. + if (errorClass === -1) { + // Check if the report is treated as normal incoming SMS + do_check_eq("sms-received", postedMessage.rilMessageType); + } else if (errorClass === 2) { + // Do nothing. + } else { + // Check Delivery Status + if (errorClass === 0) { + do_check_eq(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_SUCCESS); + } else { + do_check_eq(postedMessage.deliveryStatus, GECKO_SMS_DELIVERY_STATUS_ERROR); + } + } + } + + test_StatusReport(-1, -1); // Message Status Sub-parameter is absent. + test_StatusReport(0, 0); // 00|000000: no error|Message accepted + test_StatusReport(2, 4); // 10|000100: temporary condition|Network congestion + test_StatusReport(3, 5); // 11|000101: permanent condition|Network error + + run_next_test(); +}); diff --git a/dom/system/gonk/tests/test_ril_worker_sms_cdmapduhelper.js b/dom/system/gonk/tests/test_ril_worker_sms_cdmapduhelper.js new file mode 100644 index 00000000000..fc6db86ecf3 --- /dev/null +++ b/dom/system/gonk/tests/test_ril_worker_sms_cdmapduhelper.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this); + +function run_test() { + run_next_test(); +} + +/** + * Verify CdmaPDUHelper#encodeUserDataReplyOption. + */ +add_test(function test_CdmaPDUHelper_encodeUserDataReplyOption() { + let worker = newWorker({ + postRILMessage: function fakePostRILMessage(data) { + // Do nothing + }, + postMessage: function fakePostMessage(message) { + // Do nothing + } + }); + + let testDataBuffer = []; + worker.BitBufferHelper.startWrite(testDataBuffer); + + let helper = worker.CdmaPDUHelper; + helper.encodeUserDataReplyOption({requestStatusReport: true}); + + let expectedDataBuffer = [PDU_CDMA_MSG_USERDATA_REPLY_OPTION, 0x01, 0x40]; + + do_check_eq(testDataBuffer.length, expectedDataBuffer.length); + + for (let i = 0; i < expectedDataBuffer.length; i++) { + do_check_eq(testDataBuffer[i], expectedDataBuffer[i]); + } + + run_next_test(); +}); + +/** + * Verify CdmaPDUHelper#cdma_decodeUserDataMsgStatus. + */ +add_test(function test_CdmaPDUHelper_decodeUserDataMsgStatus() { + let worker = newWorker({ + postRILMessage: function fakePostRILMessage(data) { + // Do nothing + }, + postMessage: function fakePostMessage(message) { + // Do nothing + } + }); + + let helper = worker.CdmaPDUHelper; + function test_MsgStatus(octet) { + let testDataBuffer = [octet]; + worker.BitBufferHelper.startRead(testDataBuffer); + let result = helper.decodeUserDataMsgStatus(); + + do_check_eq(result.errorClass, octet >>> 6); + do_check_eq(result.msgStatus, octet & 0x3F); + } + + // 00|000000: no error|Message accepted + test_MsgStatus(0x00); + + // 10|000100: temporary condition|Network congestion + test_MsgStatus(0x84); + + // 11|000101: permanent condition|Network error + test_MsgStatus(0xC5); + + run_next_test(); +}); diff --git a/dom/system/gonk/tests/xpcshell.ini b/dom/system/gonk/tests/xpcshell.ini index f56ed74e95c..6953f673320 100644 --- a/dom/system/gonk/tests/xpcshell.ini +++ b/dom/system/gonk/tests/xpcshell.ini @@ -7,6 +7,8 @@ tail = [test_ril_worker_sms.js] # Bug 916067 - B2G RIL: test_ril_worker_sms.js takes too long to finish skip-if = true +[test_ril_worker_sms_cdma.js] +[test_ril_worker_sms_cdmapduhelper.js] [test_ril_worker_sms_nl_tables.js] [test_ril_worker_sms_gsmpduhelper.js] [test_ril_worker_sms_segment_info.js] From 60e1d9d07c496daaf01d7e2b0caca7d87bc79f11 Mon Sep 17 00:00:00 2001 From: Gina Yeh Date: Wed, 6 Nov 2013 19:46:23 +0800 Subject: [PATCH 05/15] Bug 935368 - Wrong interface for dbus method of DefaultAdapter, r=echou --- dom/bluetooth/linux/BluetoothDBusService.cpp | 41 ++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/dom/bluetooth/linux/BluetoothDBusService.cpp b/dom/bluetooth/linux/BluetoothDBusService.cpp index fd81f393374..2500164c2c8 100644 --- a/dom/bluetooth/linux/BluetoothDBusService.cpp +++ b/dom/bluetooth/linux/BluetoothDBusService.cpp @@ -1249,6 +1249,7 @@ private: nsRefPtr handler = new RegisterAgentReplyHandler(aAgentVTable); MOZ_ASSERT(handler.get()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); bool success = threadConnection->SendWithReply( RegisterAgentReplyHandler::Callback, handler.get(), -1, @@ -1686,17 +1687,22 @@ BluetoothDBusService::StartInternal() sPairingReqTable = new nsDataHashtable; } - // Normally we'll receive the signal 'AdapterAdded' for the default - // adapter from the DBus daemon during start up. If we restart after - // a crash, the default adapter might already be available, so we ask - // the daemon explicitly here. - bool success = mConnection->SendWithReply(OnDefaultAdapterReply, nullptr, - 1000, "/", - DBUS_ADAPTER_IFACE, - "DefaultAdapter", - DBUS_TYPE_INVALID); - if (!success) { - BT_WARNING("Failed to query default adapter!"); + /** + * Normally we'll receive the signal 'AdapterAdded' with the adapter object + * path from the DBus daemon during start up. So, there's no need to query + * the object path of default adapter here. However, if we restart from a + * crash, the default adapter might already be available, so we ask the daemon + * explicitly here. + */ + if (sAdapterPath.IsEmpty()) { + bool success = mConnection->SendWithReply(OnDefaultAdapterReply, nullptr, + 1000, "/", + DBUS_MANAGER_IFACE, + "DefaultAdapter", + DBUS_TYPE_INVALID); + if (!success) { + BT_WARNING("Failed to query default adapter!"); + } } return NS_OK; @@ -1941,6 +1947,7 @@ BluetoothDBusService::SendDiscoveryMessage(const char* aMessageName, BluetoothReplyRunnable* aRunnable) { MOZ_ASSERT(NS_IsMainThread()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); if (!IsReady()) { NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!"); @@ -1978,6 +1985,7 @@ BluetoothDBusService::SendInputMessage(const nsAString& aDeviceAddress, return NS_ERROR_FAILURE; } + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsString objectPath = GetObjectPathFromAddress(sAdapterPath, aDeviceAddress); return SendAsyncDBusMessage(objectPath, DBUS_INPUT_IFACE, aMessage, callback); } @@ -2030,6 +2038,7 @@ BluetoothDBusService::SendSinkMessage(const nsAString& aDeviceAddress, return NS_ERROR_FAILURE; } + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsString objectPath = GetObjectPathFromAddress(sAdapterPath, aDeviceAddress); return SendAsyncDBusMessage(objectPath, DBUS_SINK_IFACE, aMessage, callback); } @@ -2143,6 +2152,7 @@ protected: bool SendNextGetProperties() { MOZ_ASSERT(mProcessedDeviceAddresses < mDeviceAddresses.Length()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); // cache object path for reply mObjectPath = GetObjectPathFromAddress(sAdapterPath, @@ -2256,6 +2266,7 @@ BluetoothDBusService::SetProperty(BluetoothObjectType aType, } MOZ_ASSERT(aType < ArrayLength(sBluetoothDBusIfaces)); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); const char* interface = sBluetoothDBusIfaces[aType]; /* Compose the command */ @@ -2363,6 +2374,7 @@ BluetoothDBusService::CreatePairedDeviceInternal( sIsPairing++; nsRefPtr runnable = aRunnable; + MOZ_ASSERT(!sAdapterPath.IsEmpty()); // Then send CreatePairedDevice, it will register a temp device agent then // unregister it after pairing process is over @@ -2411,6 +2423,7 @@ BluetoothDBusService::RemoveDeviceInternal(const nsAString& aDeviceAddress, return NS_OK; } + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsCString deviceObjectPath = NS_ConvertUTF16toUTF8(GetObjectPathFromAddress(sAdapterPath, aDeviceAddress)); @@ -2785,6 +2798,7 @@ BluetoothDBusService::GetServiceChannel(const nsAString& aDeviceAddress, { MOZ_ASSERT(NS_IsMainThread()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsString objectPath(GetObjectPathFromAddress(sAdapterPath, aDeviceAddress)); #ifdef MOZ_WIDGET_GONK @@ -2841,6 +2855,7 @@ BluetoothDBusService::UpdateSdpRecords(const nsAString& aDeviceAddress, { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(!aDeviceAddress.IsEmpty()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); MOZ_ASSERT(aManager); MOZ_ASSERT(mConnection); @@ -3025,6 +3040,7 @@ BluetoothDBusService::SendMetaData(const nsAString& aTitle, return; } + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsAutoString address; a2dp->GetAddress(address); nsString objectPath = @@ -3157,6 +3173,7 @@ BluetoothDBusService::SendPlayStatus(int64_t aDuration, UpdateNotification(ControlEventId::EVENT_PLAYBACK_POS_CHANGED, aPosition); } + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsAutoString address; a2dp->GetAddress(address); nsString objectPath = @@ -3204,6 +3221,7 @@ BluetoothDBusService::UpdatePlayStatus(uint32_t aDuration, NS_ENSURE_TRUE_VOID(a2dp); MOZ_ASSERT(a2dp->IsConnected()); MOZ_ASSERT(a2dp->IsAvrcpConnected()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsAutoString address; a2dp->GetAddress(address); @@ -3234,6 +3252,7 @@ BluetoothDBusService::UpdateNotification(ControlEventId aEventId, NS_ENSURE_TRUE_VOID(a2dp); MOZ_ASSERT(a2dp->IsConnected()); MOZ_ASSERT(a2dp->IsAvrcpConnected()); + MOZ_ASSERT(!sAdapterPath.IsEmpty()); nsAutoString address; a2dp->GetAddress(address); From 2ac8ad8d1f42a624b86169bb9778e0bdb2ca30fe Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Wed, 6 Nov 2013 20:46:02 +0800 Subject: [PATCH 06/15] Bug 885679 - 1/3: B2G MMS - Add 'lastMessageSubject' to MobileMessageThread object. Interface changes. sr=gene --- .../interfaces/nsIDOMMozMobileMessageThread.idl | 5 ++++- dom/mobilemessage/interfaces/nsIMobileMessageService.idl | 3 ++- dom/mobilemessage/src/ipc/SmsTypes.ipdlh | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dom/mobilemessage/interfaces/nsIDOMMozMobileMessageThread.idl b/dom/mobilemessage/interfaces/nsIDOMMozMobileMessageThread.idl index 4a593f5fd4e..823e6bc41e6 100644 --- a/dom/mobilemessage/interfaces/nsIDOMMozMobileMessageThread.idl +++ b/dom/mobilemessage/interfaces/nsIDOMMozMobileMessageThread.idl @@ -4,12 +4,15 @@ #include "nsISupports.idl" -[scriptable, builtinclass, uuid(5efe7dc5-4f72-4b8e-9bcd-fb0676b554ca)] +[scriptable, builtinclass, uuid(9672c75d-61a2-470e-964b-2396dcff7cf6)] interface nsIDOMMozMobileMessageThread : nsISupports { // Unique identity of the thread. readonly attribute unsigned long long id; + // Last (MMS) message subject. + readonly attribute DOMString lastMessageSubject; + // Message body of the last message in the thread. readonly attribute DOMString body; diff --git a/dom/mobilemessage/interfaces/nsIMobileMessageService.idl b/dom/mobilemessage/interfaces/nsIMobileMessageService.idl index 8aef02a30ce..0e77965a94a 100644 --- a/dom/mobilemessage/interfaces/nsIMobileMessageService.idl +++ b/dom/mobilemessage/interfaces/nsIMobileMessageService.idl @@ -14,7 +14,7 @@ interface nsIDOMMozSmsSegmentInfo; #define MOBILE_MESSAGE_SERVICE_CONTRACTID "@mozilla.org/mobilemessage/mobilemessageservice;1" %} -[scriptable, builtinclass, uuid(7a39eeb4-827e-4c70-9804-288f94174ebe)] +[scriptable, builtinclass, uuid(c9a1aa14-7088-4f22-9d7f-b0c6ce9cf484)] interface nsIMobileMessageService : nsISupports { [implicit_jscontext] @@ -55,6 +55,7 @@ interface nsIMobileMessageService : nsISupports nsIDOMMozMobileMessageThread createThread(in unsigned long long id, in jsval participants, in jsval timestamp, + in DOMString lastMessageSubject, in DOMString body, in unsigned long long unreadCount, in DOMString aLastMessageType); diff --git a/dom/mobilemessage/src/ipc/SmsTypes.ipdlh b/dom/mobilemessage/src/ipc/SmsTypes.ipdlh index 5a53846f5dd..edf598a5161 100644 --- a/dom/mobilemessage/src/ipc/SmsTypes.ipdlh +++ b/dom/mobilemessage/src/ipc/SmsTypes.ipdlh @@ -92,6 +92,7 @@ struct ThreadData uint64_t id; nsString[] participants; uint64_t timestamp; + nsString lastMessageSubject; nsString body; uint64_t unreadCount; MessageType lastMessageType; From 27993c293f74d6636ae782cb1bb2c0e3cc9bc570 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Wed, 6 Nov 2013 20:46:06 +0800 Subject: [PATCH 07/15] Bug 885679 - 2/3: DOM & backend changes. r=gene --- .../src/MobileMessageService.cpp | 2 + dom/mobilemessage/src/MobileMessageThread.cpp | 13 +- dom/mobilemessage/src/MobileMessageThread.h | 2 + .../src/gonk/MobileMessageDatabaseService.js | 170 ++++++++++++------ 4 files changed, 130 insertions(+), 57 deletions(-) diff --git a/dom/mobilemessage/src/MobileMessageService.cpp b/dom/mobilemessage/src/MobileMessageService.cpp index caf4cf3a4a9..62072014b29 100644 --- a/dom/mobilemessage/src/MobileMessageService.cpp +++ b/dom/mobilemessage/src/MobileMessageService.cpp @@ -112,6 +112,7 @@ NS_IMETHODIMP MobileMessageService::CreateThread(uint64_t aId, const JS::Value& aParticipants, const JS::Value& aTimestamp, + const nsAString& aLastMessageSubject, const nsAString& aBody, uint64_t aUnreadCount, const nsAString& aLastMessageType, @@ -121,6 +122,7 @@ MobileMessageService::CreateThread(uint64_t aId, return MobileMessageThread::Create(aId, aParticipants, aTimestamp, + aLastMessageSubject, aBody, aUnreadCount, aLastMessageType, diff --git a/dom/mobilemessage/src/MobileMessageThread.cpp b/dom/mobilemessage/src/MobileMessageThread.cpp index 51767ecea21..3da1fea46a5 100644 --- a/dom/mobilemessage/src/MobileMessageThread.cpp +++ b/dom/mobilemessage/src/MobileMessageThread.cpp @@ -32,6 +32,7 @@ NS_IMPL_RELEASE(MobileMessageThread) MobileMessageThread::Create(const uint64_t aId, const JS::Value& aParticipants, const JS::Value& aTimestamp, + const nsAString& aLastMessageSubject, const nsAString& aBody, const uint64_t aUnreadCount, const nsAString& aLastMessageType, @@ -44,6 +45,7 @@ MobileMessageThread::Create(const uint64_t aId, // to them. ThreadData data; data.id() = aId; + data.lastMessageSubject().Assign(aLastMessageSubject); data.body().Assign(aBody); data.unreadCount() = aUnreadCount; @@ -114,10 +116,12 @@ MobileMessageThread::Create(const uint64_t aId, MobileMessageThread::MobileMessageThread(const uint64_t aId, const nsTArray& aParticipants, const uint64_t aTimestamp, + const nsString& aLastMessageSubject, const nsString& aBody, const uint64_t aUnreadCount, MessageType aLastMessageType) - : mData(aId, aParticipants, aTimestamp, aBody, aUnreadCount, aLastMessageType) + : mData(aId, aParticipants, aTimestamp, aLastMessageSubject, aBody, + aUnreadCount, aLastMessageType) { MOZ_ASSERT(aParticipants.Length()); } @@ -135,6 +139,13 @@ MobileMessageThread::GetId(uint64_t* aId) return NS_OK; } +NS_IMETHODIMP +MobileMessageThread::GetLastMessageSubject(nsAString& aLastMessageSubject) +{ + aLastMessageSubject = mData.lastMessageSubject(); + return NS_OK; +} + NS_IMETHODIMP MobileMessageThread::GetBody(nsAString& aBody) { diff --git a/dom/mobilemessage/src/MobileMessageThread.h b/dom/mobilemessage/src/MobileMessageThread.h index 0ac07168898..8ba9ee6b42e 100644 --- a/dom/mobilemessage/src/MobileMessageThread.h +++ b/dom/mobilemessage/src/MobileMessageThread.h @@ -26,6 +26,7 @@ public: MobileMessageThread(const uint64_t aId, const nsTArray& aParticipants, const uint64_t aTimestamp, + const nsString& aLastMessageSubject, const nsString& aBody, const uint64_t aUnreadCount, mobilemessage::MessageType aLastMessageType); @@ -35,6 +36,7 @@ public: static nsresult Create(const uint64_t aId, const JS::Value& aParticipants, const JS::Value& aTimestamp, + const nsAString& aLastMessageSubject, const nsAString& aBody, const uint64_t aUnreadCount, const nsAString& aLastMessageType, diff --git a/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js index e5e91e2fa57..f86ac05de95 100644 --- a/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js +++ b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js @@ -24,7 +24,7 @@ const DISABLE_MMS_GROUPING_FOR_RECEIVING = true; const DB_NAME = "sms"; -const DB_VERSION = 17; +const DB_VERSION = 18; const MESSAGE_STORE_NAME = "sms"; const THREAD_STORE_NAME = "thread"; const PARTICIPANT_STORE_NAME = "participant"; @@ -241,6 +241,10 @@ MobileMessageDatabaseService.prototype = { self.upgradeSchema16(event.target.transaction, next); break; case 17: + if (DEBUG) debug("Upgrade to version 18. Add last message subject into threadRecord."); + self.upgradeSchema17(event.target.transaction, next); + break; + case 18: // This will need to be moved for each new version if (DEBUG) debug("Upgrade finished."); break; @@ -1102,6 +1106,44 @@ MobileMessageDatabaseService.prototype = { }; }, + upgradeSchema17: function upgradeSchema17(transaction, next) { + let threadStore = transaction.objectStore(THREAD_STORE_NAME); + let messageStore = transaction.objectStore(MESSAGE_STORE_NAME); + + // Add 'lastMessageSubject' to each thread record. + threadStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (!cursor) { + next(); + return; + } + + let threadRecord = cursor.value; + // We have defined 'threadRecord.subject' in upgradeSchema7(), but it + // actually means 'threadRecord.body'. Swap the two values first. + threadRecord.body = threadRecord.subject; + delete threadRecord.subject; + + // Only MMS supports subject so assign null for non-MMS one. + if (threadRecord.lastMessageType != "mms") { + threadRecord.lastMessageSubject = null; + cursor.update(threadRecord); + + cursor.continue(); + return; + } + + messageStore.get(threadRecord.lastMessageId).onsuccess = function(event) { + let messageRecord = event.target.result; + let subject = messageRecord.headers.subject; + threadRecord.lastMessageSubject = subject || null; + cursor.update(threadRecord); + + cursor.continue(); + }; + }; + }, + matchParsedPhoneNumbers: function matchParsedPhoneNumbers(addr1, parsedAddr1, addr2, parsedAddr2) { if ((parsedAddr1.internationalNumber && @@ -1488,8 +1530,13 @@ MobileMessageDatabaseService.prototype = { let needsUpdate = false; if (threadRecord.lastTimestamp <= timestamp) { + let lastMessageSubject; + if (aMessageRecord.type == "mms") { + lastMessageSubject = aMessageRecord.headers.subject; + } + threadRecord.lastMessageSubject = lastMessageSubject || null; threadRecord.lastTimestamp = timestamp; - threadRecord.subject = aMessageRecord.body; + threadRecord.body = aMessageRecord.body; threadRecord.lastMessageId = aMessageRecord.id; threadRecord.lastMessageType = aMessageRecord.type; needsUpdate = true; @@ -1508,11 +1555,16 @@ MobileMessageDatabaseService.prototype = { return; } + let lastMessageSubject; + if (aMessageRecord.type == "mms") { + lastMessageSubject = aMessageRecord.headers.subject; + } threadStore.add({participantIds: participantIds, participantAddresses: aAddresses, lastMessageId: aMessageRecord.id, lastTimestamp: timestamp, - subject: aMessageRecord.body, + lastMessageSubject: lastMessageSubject || null, + body: aMessageRecord.body, unreadCount: aMessageRecord.read ? 0 : 1, lastMessageType: aMessageRecord.type}) .onsuccess = function (event) { @@ -1744,6 +1796,63 @@ MobileMessageDatabaseService.prototype = { threadParticipants = threadParticipants.concat(slicedReceivers); }, + updateThreadByMessageChange: function updateThreadByMessageChange(messageStore, + threadStore, + threadId, + messageId, + messageRead) { + threadStore.get(threadId).onsuccess = function(event) { + // This must exist. + let threadRecord = event.target.result; + if (DEBUG) debug("Updating thread record " + JSON.stringify(threadRecord)); + + if (!messageRead) { + threadRecord.unreadCount--; + } + + if (threadRecord.lastMessageId == messageId) { + // Check most recent sender/receiver. + let range = IDBKeyRange.bound([threadId, 0], [threadId, ""]); + let request = messageStore.index("threadId") + .openCursor(range, PREV); + request.onsuccess = function(event) { + let cursor = event.target.result; + if (!cursor) { + if (DEBUG) { + debug("Deleting mru entry for thread id " + threadId); + } + threadStore.delete(threadId); + return; + } + + let nextMsg = cursor.value; + let lastMessageSubject; + if (nextMsg.type == "mms") { + lastMessageSubject = nextMsg.headers.subject; + } + threadRecord.lastMessageSubject = lastMessageSubject || null; + threadRecord.lastMessageId = nextMsg.id; + threadRecord.lastTimestamp = nextMsg.timestamp; + threadRecord.body = nextMsg.body; + threadRecord.lastMessageType = nextMsg.type; + if (DEBUG) { + debug("Updating mru entry: " + + JSON.stringify(threadRecord)); + } + threadStore.put(threadRecord); + }; + } else if (!messageRead) { + // Shortcut, just update the unread count. + if (DEBUG) { + debug("Updating unread count for thread id " + threadId + ": " + + (threadRecord.unreadCount + 1) + " -> " + + threadRecord.unreadCount); + } + threadStore.put(threadRecord); + } + }; + }, + /** * nsIRilMobileMessageDatabaseService API */ @@ -1981,58 +2090,6 @@ MobileMessageDatabaseService.prototype = { this.getMessageRecordById(aMessageId, notifyCallback); }, - updateThreadByMessageChange: function updateThreadByMessageChange(messageStore, - threadStore, - threadId, - messageId, - messageRead) { - threadStore.get(threadId).onsuccess = function(event) { - // This must exist. - let threadRecord = event.target.result; - if (DEBUG) debug("Updating thread record " + JSON.stringify(threadRecord)); - - if (!messageRead) { - threadRecord.unreadCount--; - } - - if (threadRecord.lastMessageId == messageId) { - // Check most recent sender/receiver. - let range = IDBKeyRange.bound([threadId, 0], [threadId, ""]); - let request = messageStore.index("threadId") - .openCursor(range, PREV); - request.onsuccess = function(event) { - let cursor = event.target.result; - if (!cursor) { - if (DEBUG) { - debug("Deleting mru entry for thread id " + threadId); - } - threadStore.delete(threadId); - return; - } - - let nextMsg = cursor.value; - threadRecord.lastMessageId = nextMsg.id; - threadRecord.lastTimestamp = nextMsg.timestamp; - threadRecord.subject = nextMsg.body; - threadRecord.lastMessageType = nextMsg.type; - if (DEBUG) { - debug("Updating mru entry: " + - JSON.stringify(threadRecord)); - } - threadStore.put(threadRecord); - }; - } else if (!messageRead) { - // Shortcut, just update the unread count. - if (DEBUG) { - debug("Updating unread count for thread id " + threadId + ": " + - (threadRecord.unreadCount + 1) + " -> " + - threadRecord.unreadCount); - } - threadStore.put(threadRecord); - } - }; - }, - deleteMessage: function deleteMessage(messageIds, length, aRequest) { if (DEBUG) debug("deleteMessage: message ids " + JSON.stringify(messageIds)); let deleted = []; @@ -2837,7 +2894,8 @@ GetThreadsCursor.prototype = { gMobileMessageService.createThread(threadRecord.id, threadRecord.participantAddresses, threadRecord.lastTimestamp, - threadRecord.subject, + threadRecord.lastMessageSubject || "", + threadRecord.body, threadRecord.unreadCount, threadRecord.lastMessageType); self.callback.notifyCursorResult(thread); From f0a84e3dd211b9267ca4fe3748dde2ed74a720a5 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Wed, 6 Nov 2013 20:46:13 +0800 Subject: [PATCH 08/15] Bug 885679 - 3/3: test cases. r=gene --- dom/mobilemessage/tests/marionette/head.js | 301 ++++++++++++++++++ .../tests/marionette/manifest.ini | 1 + .../tests/marionette/test_thread_subject.js | 67 ++++ 3 files changed, 369 insertions(+) create mode 100644 dom/mobilemessage/tests/marionette/head.js create mode 100644 dom/mobilemessage/tests/marionette/test_thread_subject.js diff --git a/dom/mobilemessage/tests/marionette/head.js b/dom/mobilemessage/tests/marionette/head.js new file mode 100644 index 00000000000..cada5bef7ff --- /dev/null +++ b/dom/mobilemessage/tests/marionette/head.js @@ -0,0 +1,301 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers; + +let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise; + +/* Push required permissions and test if |navigator.mozMobileMessage| exists. + * Resolve if it does, reject otherwise. + * + * Forfill params: + * manager -- an reference to navigator.mozMobileMessage. + * + * Reject params: (none) + * + * @return A deferred promise. + */ +let manager; +function ensureMobileMessage() { + let deferred = Promise.defer(); + + let permissions = [{ + "type": "sms", + "allow": 1, + "context": document, + }]; + SpecialPowers.pushPermissions(permissions, function() { + ok(true, "permissions pushed: " + JSON.stringify(permissions)); + + manager = window.navigator.mozMobileMessage; + if (manager) { + log("navigator.mozMobileMessage is instance of " + manager.constructor); + } else { + log("navigator.mozMobileMessage is undefined."); + } + + if (manager instanceof MozMobileMessageManager) { + deferred.resolve(manager); + } else { + deferred.reject(); + } + }); + + return deferred.promise; +} + +/* Send a SMS message to a single receiver. Resolve if it succeeds, reject + * otherwise. + * + * Forfill params: + * message -- the sent SmsMessage. + * + * Reject params: + * error -- a DOMError. + * + * @param aReceiver the address of the receiver. + * @param aText the text body of the message. + * + * @return A deferred promise. + */ +function sendSmsWithSuccess(aReceiver, aText) { + let deferred = Promise.defer(); + + let request = manager.send(aReceiver, aText); + request.onsuccess = function(event) { + deferred.resolve(event.target.result); + }; + request.onerror = function(event) { + deferred.reject(event.target.error); + }; + + return deferred.promise; +} + +/* Send a MMS message with specified parameters. Resolve if it fails, reject + * otherwise. + * + * Forfill params: + * message -- the failed MmsMessage + * + * Reject params: (none) + * + * @param aMmsParameters a MmsParameters instance. + * + * @return A deferred promise. + */ +function sendMmsWithFailure(aMmsParameters) { + let deferred = Promise.defer(); + + manager.onfailed = function(event) { + manager.onfailed = null; + deferred.resolve(event.message); + }; + + let request = manager.sendMMS(aMmsParameters); + request.onsuccess = function(event) { + deferred.reject(); + }; + + return deferred.promise; +} + +/* Retrieve messages from database. + * + * Forfill params: + * messages -- an array of {Sms,Mms}Message instances. + * + * Reject params: + * event -- a DOMEvent + * + * @param aFilter an optional MozSmsFilter instance. + * @param aReverse a boolean value indicating whether the order of the messages + * should be reversed. + * + * @return A deferred promise. + */ +function getMessages(aFilter, aReverse) { + let deferred = Promise.defer(); + + if (!aFilter) { + aFilter = new MozSmsFilter; + } + let messages = []; + let cursor = manager.getMessages(aFilter, aReverse || false); + cursor.onsuccess = function(aEvent) { + if (cursor.result) { + messages.push(cursor.result); + cursor.continue(); + return; + } + + deferred.resolve(messages); + }; + cursor.onerror = deferred.reject.bind(deferred); + + return deferred.promise; +} + +/* Retrieve all messages from database. + * + * Forfill params: + * messages -- an array of {Sms,Mms}Message instances. + * + * Reject params: + * event -- a DOMEvent + * + * @return A deferred promise. + */ +function getAllMessages() { + return getMessages(null, false); +} + +/* Retrieve all threads from database. + * + * Forfill params: + * threads -- an array of MozMobileMessageThread instances. + * + * Reject params: + * event -- a DOMEvent + * + * @return A deferred promise. + */ +function getAllThreads() { + let deferred = Promise.defer(); + + let threads = []; + let cursor = manager.getThreads(); + cursor.onsuccess = function(aEvent) { + if (cursor.result) { + threads.push(cursor.result); + cursor.continue(); + return; + } + + deferred.resolve(threads); + }; + cursor.onerror = deferred.reject.bind(deferred); + + return deferred.promise; +} + +/* Retrieve a single specified thread from database. + * + * Forfill params: + * thread -- a MozMobileMessageThread instance. + * + * Reject params: + * event -- a DOMEvent if an error occurs in the retrieving process, or + * undefined if there's no such thread. + * + * @aThreadId a numeric value identifying the target thread. + * + * @return A deferred promise. + */ +function getThreadById(aThreadId) { + return getAllThreads() + .then(function(aThreads) { + for (let thread of aThreads) { + if (thread.id == aThreadId) { + return thread; + } + } + throw undefined; + }); +} + +/* Delete messages specified from database. + * + * Forfill params: + * result -- an array of boolean values indicating whether delesion was + * actually performed on the message record with corresponding id. + * + * Reject params: + * event -- a DOMEvent. + * + * @aMessageId an array of numeric values identifying the target messages. + * + * @return An empty array if nothing to be deleted; otherwise, a deferred promise. + */ +function deleteMessagesById(aMessageIds) { + if (!aMessageIds.length) { + ok(true, "no message to be deleted"); + return []; + } + + let deferred = Promise.defer(); + + let request = manager.delete(aMessageIds); + request.onsuccess = function(event) { + deferred.resolve(event.target.result); + }; + request.onerror = deferred.reject.bind(deferred); + + return deferred.promise; +} + +/* Delete messages specified from database. + * + * Forfill params: + * result -- an array of boolean values indicating whether delesion was + * actually performed on the message record with corresponding id. + * + * Reject params: + * event -- a DOMEvent. + * + * @aMessages an array of {Sms,Mms}Message instances. + * + * @return A deferred promise. + */ +function deleteMessages(aMessages) { + let ids = messagesToIds(aMessages); + return deleteMessagesById(ids); +} + +/* Delete all messages from database. + * + * Forfill params: + * ids -- an array of numeric values identifying those deleted + * {Sms,Mms}Messages. + * + * Reject params: + * event -- a DOMEvent. + * + * @return A deferred promise. + */ +function deleteAllMessages() { + return getAllMessages().then(deleteMessages); +} + +/* Create a new array of id attribute of input messages. + * + * @param aMessages an array of {Sms,Mms}Message instances. + * + * @return an array of numeric values. + */ +function messagesToIds(aMessages) { + let ids = []; + for (let message of aMessages) { + ids.push(message.id); + } + return ids; +} + +/* Flush permission settings and call |finish()|. + */ +function cleanUp() { + SpecialPowers.flushPermissions(function() { + // Use ok here so that we have at least one test run. + ok(true, "permissions flushed"); + + finish(); + }); +} + +function startTestCommon(aTestCaseMain) { + ensureMobileMessage() + .then(deleteAllMessages) + .then(aTestCaseMain) + .then(deleteAllMessages) + .then(cleanUp, cleanUp); +} diff --git a/dom/mobilemessage/tests/marionette/manifest.ini b/dom/mobilemessage/tests/marionette/manifest.ini index b61c693de1a..3663e2211b7 100644 --- a/dom/mobilemessage/tests/marionette/manifest.ini +++ b/dom/mobilemessage/tests/marionette/manifest.ini @@ -38,3 +38,4 @@ qemu = true [test_getthreads.js] [test_smsc_address.js] [test_dsds_default_service_id.js] +[test_thread_subject.js] diff --git a/dom/mobilemessage/tests/marionette/test_thread_subject.js b/dom/mobilemessage/tests/marionette/test_thread_subject.js new file mode 100644 index 00000000000..a15c8a6ec18 --- /dev/null +++ b/dom/mobilemessage/tests/marionette/test_thread_subject.js @@ -0,0 +1,67 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +MARIONETTE_TIMEOUT = 60000; +MARIONETTE_HEAD_JS = 'head.js'; + +const PHONE_NUMBER = "+1234567890"; + +// Have a long long subject causes the send fails, so we don't need +// networking here. +const MMS_MAX_LENGTH_SUBJECT = 40; +function genMmsSubject(sep) { + return "Hello " + (new Array(MMS_MAX_LENGTH_SUBJECT).join(sep)) + " World!"; +} + +function testSms(aProgressStr, aText) { + log("Testing thread subject: " + aProgressStr); + + return sendSmsWithSuccess(PHONE_NUMBER, aText) + .then(function(message) { + log(" SMS sent, retrieving thread of id " + message.threadId); + return getThreadById(message.threadId); + }) + .then(function(thread) { + log(" Got thread.lastMessageSubject = '" + thread.lastMessageSubject + "'"); + is(thread.lastMessageSubject, "", "thread.lastMessageSubject"); + }); +} + +function testMms(aProgressStr, aSubject) { + log("Testing thread subject: " + aProgressStr); + + let mmsParameters = { + receivers: [PHONE_NUMBER], + subject: aSubject, + attachments: [], + }; + + // We use a long long message subject so it will always fail. + return sendMmsWithFailure(mmsParameters) + .then(function(message) { + log(" MMS sent, retrieving thread of id " + message.threadId); + return getThreadById(message.threadId); + }) + .then(function(thread) { + log(" Got thread.lastMessageSubject = '" + thread.lastMessageSubject + "'"); + is(thread.lastMessageSubject, aSubject, "thread.lastMessageSubject"); + }); +} + +startTestCommon(function testCaseMain() { + return testSms("SMS", "text") + .then(testMms.bind(null, "SMS..MMS", genMmsSubject(" "))) + .then(testSms.bind(null, "SMS..MMS..SMS", "text")) + .then(deleteAllMessages) + .then(testMms.bind(null, "MMS", genMmsSubject(" "))) + .then(testSms.bind(null, "MMS..SMS", "text")) + .then(testMms.bind(null, "MMS..SMS..MMS", genMmsSubject(" "))) + .then(deleteAllMessages) + .then(testSms.bind(null, "SMS", "1")) + .then(testSms.bind(null, "SMS..SMS", "2")) + .then(testSms.bind(null, "SMS..SMS..SMS", "3")) + .then(deleteAllMessages) + .then(testMms.bind(null, "MMS", genMmsSubject("a"))) + .then(testMms.bind(null, "MMS..MMS", genMmsSubject("b"))) + .then(testMms.bind(null, "MMS..MMS..MMS", genMmsSubject("c"))); +}); From fe68c53fbdca24a94839cfa3a6e30a00e1dc565b Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Wed, 6 Nov 2013 05:05:25 -0800 Subject: [PATCH 09/15] Bumping gaia.json for 1 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/18667a9b93ea Author: Julien Wajsberg Desc: Bug 935442 - [System] 1 unit tests failure with the latest firefox builds r=alive --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e785246b791..fbde0975061 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "8b613bca552487199ee0f9ecebe43fa854387a88", + "revision": "18667a9b93eaccd93d7f1fa681e4e32aa63405a3", "repo_path": "/integration/gaia-central" } From efc1ee9d35b8fc502dd4e30dfb2459db3b6bcf98 Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Wed, 6 Nov 2013 08:44:57 -0500 Subject: [PATCH 10/15] Bug 911387 - Add calling CompositableBackendSpecificData::ClearData() in Detach(). r=nical --- gfx/layers/composite/CompositableHost.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/layers/composite/CompositableHost.h b/gfx/layers/composite/CompositableHost.h index 02aa294685e..2c22d5ab3b0 100644 --- a/gfx/layers/composite/CompositableHost.h +++ b/gfx/layers/composite/CompositableHost.h @@ -269,6 +269,9 @@ public: SetCompositor(nullptr); mAttached = false; mKeepAttached = false; + if (mBackendData) { + mBackendData->ClearData(); + } } } bool IsAttached() { return mAttached; } From 0f8fc0a9bf28498e22b2639224424e7b0cca8f69 Mon Sep 17 00:00:00 2001 From: Kai-Zhen Li Date: Wed, 6 Nov 2013 10:08:42 +0800 Subject: [PATCH 11/15] Bug 934924 - Check EI_ABIVERSION for jb4.2.2 build. r=jld --- tools/profiler/EHABIStackWalk.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/profiler/EHABIStackWalk.cpp b/tools/profiler/EHABIStackWalk.cpp index 06969e13926..cacd1cd84b7 100644 --- a/tools/profiler/EHABIStackWalk.cpp +++ b/tools/profiler/EHABIStackWalk.cpp @@ -524,7 +524,9 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) file.e_ident[EI_DATA] != hostEndian || file.e_ident[EI_VERSION] != EV_CURRENT || file.e_ident[EI_OSABI] != ELFOSABI_SYSV || +#ifdef EI_ABIVERSION file.e_ident[EI_ABIVERSION] != 0 || +#endif file.e_machine != EM_ARM || file.e_version != EV_CURRENT) // e_flags? From d998b90c6afdb472bc77a40b7b8f90f355a980ad Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Wed, 6 Nov 2013 06:50:24 -0800 Subject: [PATCH 12/15] Bumping gaia.json for 6 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/54c9ca64aa49 Author: Zac Desc: Merge pull request #13423 from AndreiH/bug935428 Bug 935428 - Mark test_geolocation_prompt.py as expected fail ======== https://hg.mozilla.org/integration/gaia-central/rev/badbc86c3be6 Author: Andrei Hutusoru Desc: Bug 935428 - Mark test_geolocation_prompt.py as expected fail ======== https://hg.mozilla.org/integration/gaia-central/rev/3b61b3a852e3 Author: Zac Desc: Merge pull request #13426 from zacc/bug_935444 bug 935444 - Python, bolster wait for call screen to have loaded r=Bebe ... ======== https://hg.mozilla.org/integration/gaia-central/rev/e7b8904328ca Author: Zac Campbell Desc: bug 935444 - Python, bolster wait for call screen to have loaded r=Bebe r=Andreih ======== https://hg.mozilla.org/integration/gaia-central/rev/a4be789913f4 Author: Julien Wajsberg Desc: Merge pull request #13427 from julienw/935441-fix-keyboard-unit-tests Bug 935441 - [Keyboard] 2 unit tests failures with the latest firefox bu... ======== https://hg.mozilla.org/integration/gaia-central/rev/5413cf5ae17e Author: Julien Wajsberg Desc: Bug 935441 - [Keyboard] 2 unit tests failures with the latest firefox builds r=janjongboom Defines the property on `window` itself. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index fbde0975061..f92784e677e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "18667a9b93eaccd93d7f1fa681e4e32aa63405a3", + "revision": "54c9ca64aa49bd72dd3a3226177282dcb23e7550", "repo_path": "/integration/gaia-central" } From 6e357ac8b4f762a433ba0b6347920825902d5f55 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Wed, 6 Nov 2013 07:36:28 -0800 Subject: [PATCH 13/15] Bumping gaia.json for 1 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/a9dc5748f9e8 Author: Gabriele Svelto Desc: Bug 911944 - Handle message actions and increase test coverage r=julienw - Added parsing message actions in SI and SL messages - Implemented specific behavior for actions such as delete and signal-none - Fixed a minor issue when doing age-based message replacement - Added unit-tests for the new functionality - Added unit-tests coverage to the MessageDB object - Corrected all jshint linting errors --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index f92784e677e..ca628162b8b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "54c9ca64aa49bd72dd3a3226177282dcb23e7550", + "revision": "a9dc5748f9e8bdf17645dcc0da75ff6cf717df6a", "repo_path": "/integration/gaia-central" } From a59bce9b5b614ed326b1b63416eb7745ffb14880 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Thu, 18 Jul 2013 07:18:00 +0800 Subject: [PATCH 14/15] Bug 835143: Implement StkCommandEvent using event generator. f=vyang. r=smaug --- .../test/test_all_synthetic_events.html | 4 +- dom/bindings/Bindings.conf | 4 - dom/icc/interfaces/SimToolKit.idl | 10 --- dom/icc/src/IccManager.cpp | 29 ++++++- dom/icc/src/StkCommandEvent.cpp | 47 ------------ dom/icc/src/StkCommandEvent.h | 75 ------------------- dom/icc/src/moz.build | 2 - dom/webidl/MozStkCommandEvent.webidl | 8 +- dom/webidl/moz.build | 3 +- 9 files changed, 36 insertions(+), 146 deletions(-) delete mode 100644 dom/icc/src/StkCommandEvent.cpp delete mode 100644 dom/icc/src/StkCommandEvent.h diff --git a/content/events/test/test_all_synthetic_events.html b/content/events/test/test_all_synthetic_events.html index d5bd67f6ff5..4655a3a3200 100644 --- a/content/events/test/test_all_synthetic_events.html +++ b/content/events/test/test_all_synthetic_events.html @@ -250,7 +250,9 @@ const kEventConstructors = { return new MozSmsEvent(aName, aProps); }, }, - MozStkCommandEvent: { create: null, // Cannot create untrusted event from JS. + MozStkCommandEvent: { create: function (aName, aProps) { + return new MozStkCommandEvent(aName, aProps); + }, }, MozVoicemailEvent: { create: function (aName, aProps) { return new MozVoicemailEvent(aName, aProps); diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 820c124cec3..6932298b2b0 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -792,10 +792,6 @@ DOMInterfaces = { 'nativeType': 'mozilla::dom::PowerManager', }, -'MozStkCommandEvent' : { - 'nativeType': 'mozilla::dom::StkCommandEvent', -}, - 'MozTimeManager': { 'nativeType': 'mozilla::dom::time::TimeManager', }, diff --git a/dom/icc/interfaces/SimToolKit.idl b/dom/icc/interfaces/SimToolKit.idl index 5bbccef132e..b2dc80bd3b0 100644 --- a/dom/icc/interfaces/SimToolKit.idl +++ b/dom/icc/interfaces/SimToolKit.idl @@ -494,16 +494,6 @@ dictionary MozStkCommand jsval options; }; -[scriptable, builtinclass, uuid(21cd2f25-ebea-43f8-8255-eaa4e1182858)] -interface nsIDOMMozStkCommandEvent : nsIDOMEvent -{ - /** - * See nsIDOMMozStkCommand for the detail of command. - */ - [implicit_jscontext] - readonly attribute jsval command; -}; - dictionary MozStkResponse { /** diff --git a/dom/icc/src/IccManager.cpp b/dom/icc/src/IccManager.cpp index 552c62c3236..5a9e7218749 100644 --- a/dom/icc/src/IccManager.cpp +++ b/dom/icc/src/IccManager.cpp @@ -5,10 +5,11 @@ #include "mozilla/dom/IccManager.h" #include "GeneratedEvents.h" -#include "mozilla/dom/StkCommandEvent.h" +#include "mozilla/dom/MozStkCommandEvent.h" #include "mozilla/Services.h" #include "nsIDOMClassInfo.h" #include "nsIDOMIccInfo.h" +#include "nsJSON.h" #include "SimToolKit.h" #define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1" @@ -264,10 +265,30 @@ NS_IMPL_EVENT_HANDLER(IccManager, iccinfochange) NS_IMETHODIMP IccManager::NotifyStkCommand(const nsAString& aMessage) { - nsRefPtr event = StkCommandEvent::Create(this, aMessage); - NS_ASSERTION(event, "This should never fail!"); + nsresult rv; + nsIScriptContext* sc = GetContextForEventHandlers(&rv); + NS_ENSURE_SUCCESS(rv, rv); - return event->Dispatch(this, NS_LITERAL_STRING("stkcommand")); + AutoPushJSContext cx(sc->GetNativeContext()); + JS::Rooted value(cx); + + if (!aMessage.IsEmpty()) { + nsCOMPtr json(new nsJSON()); + nsresult rv = json->DecodeToJSVal(aMessage, cx, value.address()); + NS_ENSURE_SUCCESS(rv, rv); + } else { + value = JSVAL_VOID; + } + + MozStkCommandEventInit init; + init.mBubbles = false; + init.mCancelable = false; + init.mCommand = value; + + nsRefPtr event = + MozStkCommandEvent::Constructor(this, NS_LITERAL_STRING("stkcommand"), init); + + return DispatchTrustedEvent(event); } NS_IMETHODIMP diff --git a/dom/icc/src/StkCommandEvent.cpp b/dom/icc/src/StkCommandEvent.cpp deleted file mode 100644 index 66c5b26899b..00000000000 --- a/dom/icc/src/StkCommandEvent.cpp +++ /dev/null @@ -1,47 +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 "mozilla/dom/StkCommandEvent.h" - -#include "jsfriendapi.h" -#include "nsJSON.h" -#include "SimToolKit.h" - -namespace mozilla { -namespace dom { - -already_AddRefed -StkCommandEvent::Create(EventTarget* aOwner, - const nsAString& aMessage) -{ - nsRefPtr event = new StkCommandEvent(aOwner); - event->mCommand = aMessage; - return event.forget(); -} - -NS_IMPL_ADDREF_INHERITED(StkCommandEvent, nsDOMEvent) -NS_IMPL_RELEASE_INHERITED(StkCommandEvent, nsDOMEvent) - -NS_INTERFACE_MAP_BEGIN(StkCommandEvent) - NS_INTERFACE_MAP_ENTRY(nsIDOMMozStkCommandEvent) -NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) - -NS_IMETHODIMP -StkCommandEvent::GetCommand(JSContext* aCx, JS::Value* aCommand) - -{ - nsCOMPtr json(new nsJSON()); - - if (!mCommand.IsEmpty()) { - nsresult rv = json->DecodeToJSVal(mCommand, aCx, aCommand); - NS_ENSURE_SUCCESS(rv, rv); - } else { - *aCommand = JSVAL_VOID; - } - - return NS_OK; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/icc/src/StkCommandEvent.h b/dom/icc/src/StkCommandEvent.h deleted file mode 100644 index 4d479a76033..00000000000 --- a/dom/icc/src/StkCommandEvent.h +++ /dev/null @@ -1,75 +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/. */ - -#ifndef mozilla_dom_StkCommandEvent_h -#define mozilla_dom_StkCommandEvent_h - -#include "mozilla/dom/MozStkCommandEventBinding.h" -#include "nsDOMEvent.h" -#include "SimToolKit.h" - -namespace mozilla { -namespace dom { - -class StkCommandEvent : public nsDOMEvent, - public nsIDOMMozStkCommandEvent -{ - nsString mCommand; - -public: - NS_DECL_ISUPPORTS_INHERITED - NS_FORWARD_TO_NSDOMEVENT - NS_DECL_NSIDOMMOZSTKCOMMANDEVENT - - static already_AddRefed - Create(EventTarget* aOwner, const nsAString& aMessage); - - nsresult - Dispatch(EventTarget* aTarget, const nsAString& aEventType) - { - NS_ASSERTION(aTarget, "Null pointer!"); - NS_ASSERTION(!aEventType.IsEmpty(), "Empty event type!"); - - nsresult rv = InitEvent(aEventType, false, false); - NS_ENSURE_SUCCESS(rv, rv); - - SetTrusted(true); - - nsDOMEvent* thisEvent = this; - - bool dummy; - rv = aTarget->DispatchEvent(thisEvent, &dummy); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; - } - - virtual JSObject* WrapObject(JSContext* aCx, - JS::Handle aScope) MOZ_OVERRIDE - { - return MozStkCommandEventBinding::Wrap(aCx, aScope, this); - } - - JS::Value GetCommand(JSContext* aCx, ErrorResult& aRv) - { - JS::Rooted retVal(aCx); - aRv = GetCommand(aCx, retVal.address()); - return retVal; - } - -private: - StkCommandEvent(EventTarget* aOwner) - : nsDOMEvent(aOwner, nullptr, nullptr) - { - SetIsDOMBinding(); - } - - ~StkCommandEvent() - { } -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_StkCommandEvent_h diff --git a/dom/icc/src/moz.build b/dom/icc/src/moz.build index 67ed79bf41f..1145715d934 100644 --- a/dom/icc/src/moz.build +++ b/dom/icc/src/moz.build @@ -6,12 +6,10 @@ EXPORTS.mozilla.dom += [ 'IccManager.h', - 'StkCommandEvent.h', ] SOURCES += [ 'IccManager.cpp', - 'StkCommandEvent.cpp', ] FAIL_ON_WARNINGS = True diff --git a/dom/webidl/MozStkCommandEvent.webidl b/dom/webidl/MozStkCommandEvent.webidl index bfe8ec3fa3e..9e55fe7abda 100644 --- a/dom/webidl/MozStkCommandEvent.webidl +++ b/dom/webidl/MozStkCommandEvent.webidl @@ -4,8 +4,14 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ +[Pref="dom.icc.enabled", + Constructor(DOMString type, optional MozStkCommandEventInit eventInitDict)] interface MozStkCommandEvent : Event { - [Throws] readonly attribute any command; }; + +dictionary MozStkCommandEventInit : EventInit +{ + any command = null; +}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 861fe570a22..c2424108f2e 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -515,7 +515,6 @@ if CONFIG['MOZ_B2G_RIL']: 'MozCellBroadcastEvent.webidl', 'MozEmergencyCbModeEvent.webidl', 'MozOtaStatusEvent.webidl', - 'MozStkCommandEvent.webidl', 'MozVoicemail.webidl', 'MozVoicemailEvent.webidl', 'USSDReceivedEvent.webidl', @@ -560,6 +559,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [ 'MediaStreamEvent.webidl', 'MozContactChangeEvent.webidl', 'MozInterAppMessageEvent.webidl', + 'MozStkCommandEvent.webidl', 'RTCDataChannelEvent.webidl', 'RTCPeerConnectionIceEvent.webidl', 'TrackEvent.webidl', @@ -572,4 +572,3 @@ if CONFIG['MOZ_GAMEPAD']: 'GamepadButtonEvent.webidl', 'GamepadEvent.webidl', ] - From dc916a8b816fc0587254f20d37d1bce4f678cec5 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Wed, 6 Nov 2013 08:25:25 -0800 Subject: [PATCH 15/15] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d995823e80fa Author: George Desc: Merge pull request #13433 from cctuan/935547 Bug 935547 - [Flatfish][System] wrong screen size after rebooting on homescreen ======== https://hg.mozilla.org/integration/gaia-central/rev/d461cec2873c Author: cctuan Desc: Bug 935547 - [Flatfish][System] wrong screen size after rebooting on homescreen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ca628162b8b..c715bcf7916 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "a9dc5748f9e8bdf17645dcc0da75ff6cf717df6a", + "revision": "d995823e80fa7f2e67263699bb6e42a6bcde65ea", "repo_path": "/integration/gaia-central" }