Bug 1154186 - Deprecate nsISmsMessenger_new.idl. r=echen
authorBevis Tseng <btseng@mozilla.com>
Tue, 14 Apr 2015 18:07:44 +0800
changeset 269191 71c9c390342221e9b1c4621cb75dc618646154b1
parent 269190 6d13676c54dda5a1af151b60ec3bd6f8d2205b25
child 269192 ac6b9bb8e82d4abae605e74b365c353a88bf46c7
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1154186
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1154186 - Deprecate nsISmsMessenger_new.idl. r=echen
dom/mobilemessage/gonk/SmsService.js
dom/mobilemessage/interfaces/nsISmsMessenger.idl
dom/system/gonk/RILSystemMessengerHelper.js
dom/system/gonk/tests/test_ril_system_messenger.js
--- a/dom/mobilemessage/gonk/SmsService.js
+++ b/dom/mobilemessage/gonk/SmsService.js
@@ -305,17 +305,17 @@ SmsService.prototype = {
           .setMessageDeliveryByMessageId(aDomMessage.id,
                                          null,
                                          DOM_MOBILE_MESSAGE_DELIVERY_ERROR,
                                          RIL.GECKO_SMS_DELIVERY_STATUS_ERROR,
                                          null,
                                          (aRv, aDomMessage) => {
           // TODO bug 832140 handle !Components.isSuccessCode(aRv)
           this._broadcastSmsSystemMessage(
-            Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_SENT_FAILED, aDomMessage);
+            Ci.nsISmsMessenger.NOTIFICATION_TYPE_SENT_FAILED, aDomMessage);
           aRequest.notifySendMessageFailed(error, aDomMessage);
           Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null);
         });
         return false;
       } // End of send failure.
 
       // Message was sent to SMSC.
       if (!aResponse.deliveryStatus) {
@@ -376,17 +376,17 @@ SmsService.prototype = {
                                        (aRv, aDomMessage) => {
         // TODO bug 832140 handle !Components.isSuccessCode(aRv)
 
         let [topic, notificationType] =
           (aResponse.deliveryStatus == RIL.GECKO_SMS_DELIVERY_STATUS_SUCCESS)
             ? [kSmsDeliverySuccessObserverTopic,
                Ci.nsISmsMessenger.NOTIFICATION_TYPE_DELIVERY_SUCCESS]
             : [kSmsDeliveryErrorObserverTopic,
-               Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_DELIVERY_ERROR];
+               Ci.nsISmsMessenger.NOTIFICATION_TYPE_DELIVERY_ERROR];
 
         // Broadcasting a "sms-delivery-success/sms-delivery-error" system
         // message to open apps.
         this._broadcastSmsSystemMessage(notificationType, aDomMessage);
 
         // Notifying observers the delivery status is updated.
         Services.obs.notifyObservers(aDomMessage, topic, null);
       });
@@ -860,17 +860,17 @@ SmsService.prototype = {
       timestamp: Date.now(),
       iccId: this._getIccId(aServiceId)
     };
 
     let saveSendingMessageCallback = (aRv, aSendingMessage) => {
       if (!Components.isSuccessCode(aRv)) {
         if (DEBUG) debug("Error! Fail to save sending message! aRv = " + aRv);
         this._broadcastSmsSystemMessage(
-          Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_SENT_FAILED, aSendingMessage);
+          Ci.nsISmsMessenger.NOTIFICATION_TYPE_SENT_FAILED, aSendingMessage);
         aRequest.notifySendMessageFailed(
           gMobileMessageDatabaseService.translateCrErrorToMessageCallbackError(aRv),
           aSendingMessage);
         Services.obs.notifyObservers(aSendingMessage, kSmsFailedObserverTopic, null);
         return;
       }
 
       if (!aSilent) {
@@ -905,17 +905,17 @@ SmsService.prototype = {
           .setMessageDeliveryByMessageId(aSendingMessage.id,
                                          null,
                                          DOM_MOBILE_MESSAGE_DELIVERY_ERROR,
                                          RIL.GECKO_SMS_DELIVERY_STATUS_ERROR,
                                          null,
                                          (aRv, aDomMessage) => {
           // TODO bug 832140 handle !Components.isSuccessCode(aRv)
           this._broadcastSmsSystemMessage(
-            Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_SENT_FAILED, aDomMessage);
+            Ci.nsISmsMessenger.NOTIFICATION_TYPE_SENT_FAILED, aDomMessage);
           aRequest.notifySendMessageFailed(errorCode, aDomMessage);
           Services.obs.notifyObservers(aDomMessage, kSmsFailedObserverTopic, null);
         });
         return;
       }
 
       this._sendToTheAir(aServiceId, aSendingMessage, aSilent, options, aRequest);
     }; // End of |saveSendingMessageCallback|.
--- a/dom/mobilemessage/interfaces/nsISmsMessenger.idl
+++ b/dom/mobilemessage/interfaces/nsISmsMessenger.idl
@@ -1,24 +1,28 @@
 /* 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 "domstubs.idl"
 #include "nsISupports.idl"
 
-[scriptable, uuid(f77ad4d4-68a9-11e4-920f-0b26b7a5e713)]
+[scriptable, uuid(3be7c6ac-e27d-11e4-b6da-7bbe0e4cd4ec)]
 interface nsISmsMessenger : nsISupports
 {
   /* 'sms-received' system message */
   const unsigned short NOTIFICATION_TYPE_RECEIVED = 0;
   /* 'sms-sent' system message */
   const unsigned short NOTIFICATION_TYPE_SENT = 1;
   /* 'sms-delivery-success' system message */
   const unsigned short NOTIFICATION_TYPE_DELIVERY_SUCCESS = 2;
+  /* 'sms-failed' system message */
+  const unsigned short NOTIFICATION_TYPE_SENT_FAILED = 3;
+  /* 'sms-delivery-error' system message */
+  const unsigned short NOTIFICATION_TYPE_DELIVERY_ERROR = 4;
 
   /**
    * To broadcast system messages of 'sms-received', 'sms-delivery-success',
    * 'sms-sent', 'sms-failed' and 'sms-delivery-error'.
    *
    * Note: Except aNotificationType, all parameters are the attributes of the
    * nsIDOMMozSmsMessage generated by nsIMobileMessageService.createSmsMessage().
    *
@@ -63,17 +67,8 @@ interface nsISmsMessenger : nsISupports
                  in DOMString aReceiver,
                  in DOMString aBody,
                  in unsigned long aMessageClass,
                  in DOMTimeStamp aTimestamp,
                  in DOMTimeStamp aSentTimestamp,
                  in DOMTimeStamp aDeliveryTimestamp,
                  in boolean aRead);
 };
-
-[scriptable, uuid(1e293188-d845-11e4-bc92-af2bf0a70344)]
-interface nsISmsMessenger_new : nsISmsMessenger
-{
-  /* 'sms-failed' system message */
-  const unsigned short NOTIFICATION_TYPE_SENT_FAILED = 3;
-  /* 'sms-delivery-error' system message */
-  const unsigned short NOTIFICATION_TYPE_DELIVERY_ERROR = 4;
-};
--- a/dom/system/gonk/RILSystemMessengerHelper.js
+++ b/dom/system/gonk/RILSystemMessengerHelper.js
@@ -46,17 +46,16 @@ function RILSystemMessengerHelper() {
     gSystemMessenger.broadcastMessage(aType, aMessage);
   };
 }
 RILSystemMessengerHelper.prototype = {
 
   classID: RILSYSTEMMESSENGERHELPER_CID,
   QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyMessenger,
                                          Ci.nsISmsMessenger,
-                                         Ci.nsISmsMessenger_new,
                                          Ci.nsICellbroadcastMessenger,
                                          Ci.nsIMobileConnectionMessenger,
                                          Ci.nsIIccMessenger]),
 
   /**
    * RILSystemMessenger instance.
    */
   messenger: null,
--- a/dom/system/gonk/tests/test_ril_system_messenger.js
+++ b/dom/system/gonk/tests/test_ril_system_messenger.js
@@ -55,31 +55,27 @@ function equal_received_system_message(a
  */
 function run_test() {
   let telephonyMessenger = Cc["@mozilla.org/ril/system-messenger-helper;1"]
                            .getService(Ci.nsITelephonyMessenger);
 
   let smsMessenger = Cc["@mozilla.org/ril/system-messenger-helper;1"]
                      .getService(Ci.nsISmsMessenger);
 
-  let smsMessenger_new = Cc["@mozilla.org/ril/system-messenger-helper;1"]
-                         .getService(Ci.nsISmsMessenger_new);
-
   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);
 
   let iccMessenger = Cc["@mozilla.org/ril/system-messenger-helper;1"]
                      .getService(Ci.nsIIccMessenger);
 
   ok(telephonyMessenger !== null, "Get TelephonyMessenger.");
   ok(smsMessenger != null, "Get SmsMessenger.");
-  ok(smsMessenger_new != null, "Get SmsMessenger_new.");
   ok(cellbroadcastMessenger != null, "Get CellbroadcastMessenger.");
   ok(mobileConnectionMessenger != null, "Get MobileConnectionMessenger.");
   ok(iccMessenger != null, "Get IccMessenger.");
 
   run_next_test();
 }
 
 /**
@@ -243,17 +239,17 @@ add_test(function test_sms_messenger_not
       messageClass:      "normal",
       timestamp:         timestamp,
       sentTimestamp:     0,
       deliveryTimestamp: deliveryTimestamp,
       read:              true
     });
 
   // Verify 'sms-failed' system message.
-  messenger.notifySms(Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_SENT_FAILED,
+  messenger.notifySms(Ci.nsISmsMessenger.NOTIFICATION_TYPE_SENT_FAILED,
                       7,
                       8,
                       "99887766554433221100",
                       Ci.nsISmsService.DELIVERY_TYPE_ERROR,
                       Ci.nsISmsService.DELIVERY_STATUS_TYPE_ERROR,
                       null,
                       "+0987654321",
                       "Outgoing message",
@@ -276,17 +272,17 @@ add_test(function test_sms_messenger_not
       messageClass:      "normal",
       timestamp:         timestamp,
       sentTimestamp:     0,
       deliveryTimestamp: 0,
       read:              true
     });
 
   // Verify 'sms-delivery-error' system message.
-  messenger.notifySms(Ci.nsISmsMessenger_new.NOTIFICATION_TYPE_DELIVERY_ERROR,
+  messenger.notifySms(Ci.nsISmsMessenger.NOTIFICATION_TYPE_DELIVERY_ERROR,
                       9,
                       10,
                       "99887766554433221100",
                       Ci.nsISmsService.DELIVERY_TYPE_SENT,
                       Ci.nsISmsService.DELIVERY_STATUS_TYPE_ERROR,
                       null,
                       "+0987654321",
                       "Outgoing message",