Bug 913436 - Gecko needs to return a proper error code when sending messages to non-FDN receivers. r=vicamo a=koi+
authorGene Lian <clian@mozilla.com>
Mon, 09 Sep 2013 21:48:07 +0800
changeset 146193 682977ca05de68d6af5e94c09536157e153376b0
parent 146192 5b5b2b8f57f8cbccffb4a1f30b260776911f1474
child 146194 486b61c42838c754203a46b3615751bf11c3f2fa
push id25244
push userryanvm@gmail.com
push dateMon, 09 Sep 2013 20:03:14 +0000
treeherdermozilla-central@f320b8c034bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo, koi
bugs913436
milestone26.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 913436 - Gecko needs to return a proper error code when sending messages to non-FDN receivers. r=vicamo a=koi+
dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
dom/mobilemessage/src/MobileMessageCallback.cpp
dom/system/gonk/RadioInterfaceLayer.js
embedding/android/GeckoSmsManager.java
mobile/android/base/GeckoSmsManager.java
--- a/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
+++ b/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
@@ -9,32 +9,33 @@ dictionary SmsThreadListItem
 {
   unsigned long long id;
   DOMString senderOrReceiver;
   unsigned long long timestamp;
   DOMString body;
   unsigned long long unreadCount;
 };
 
-[scriptable, uuid(399125a8-00d2-11e3-8d12-3fba4465c097)]
+[scriptable, uuid(5f82f826-1956-11e3-a2bb-9b043b33de27)]
 interface nsIMobileMessageCallback : nsISupports
 {
   /**
    * All SMS related errors.
    * Make sure to keep this list in sync with the list in:
    * embedding/android/GeckoSmsManager.java
    */
   const unsigned short SUCCESS_NO_ERROR          = 0;
   const unsigned short NO_SIGNAL_ERROR           = 1;
   const unsigned short NOT_FOUND_ERROR           = 2;
   const unsigned short UNKNOWN_ERROR             = 3;
   const unsigned short INTERNAL_ERROR            = 4;
   const unsigned short NO_SIM_CARD_ERROR         = 5;
   const unsigned short RADIO_DISABLED_ERROR      = 6;
   const unsigned short INVALID_ADDRESS_ERROR     = 7;
+  const unsigned short FDN_CHECK_ERROR           = 8;
 
   /**
    * |message| can be nsIDOMMoz{Mms,Sms}Message.
    */
   void notifyMessageSent(in nsISupports message);
   void notifySendMessageFailed(in long error);
 
   /**
--- a/dom/mobilemessage/src/MobileMessageCallback.cpp
+++ b/dom/mobilemessage/src/MobileMessageCallback.cpp
@@ -99,16 +99,19 @@ MobileMessageCallback::NotifyError(int32
       errorStr = NS_LITERAL_STRING("NoSimCardError");
       break;
     case nsIMobileMessageCallback::RADIO_DISABLED_ERROR:
       errorStr = NS_LITERAL_STRING("RadioDisabledError");
       break;
     case nsIMobileMessageCallback::INVALID_ADDRESS_ERROR:
       errorStr = NS_LITERAL_STRING("InvalidAddressError");
       break;
+    case nsIMobileMessageCallback::FDN_CHECK_ERROR:
+      errorStr = NS_LITERAL_STRING("FdnCheckError");
+      break;
     default: // SUCCESS_NO_ERROR is handled above.
       MOZ_CRASH("Should never get here!");
   }
 
   if (aAsync) {
     nsCOMPtr<nsIDOMRequestService> rs =
       do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
     NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -2671,16 +2671,19 @@ RadioInterface.prototype = {
                                 (function(context, response) {
         if (response.errorMsg) {
           // Failed to send SMS out.
           let error = Ci.nsIMobileMessageCallback.UNKNOWN_ERROR;
           switch (response.errorMsg) {
             case RIL.ERROR_RADIO_NOT_AVAILABLE:
               error = Ci.nsIMobileMessageCallback.NO_SIGNAL_ERROR;
               break;
+            case RIL.ERROR_FDN_CHECK_FAILURE:
+              error = Ci.nsIMobileMessageCallback.FDN_CHECK_ERROR;
+              break;
           }
 
           if (context.silent) {
             context.request.notifySendMessageFailed(error);
             return false;
           }
 
           gMobileMessageDatabaseService
--- a/embedding/android/GeckoSmsManager.java
+++ b/embedding/android/GeckoSmsManager.java
@@ -304,16 +304,17 @@ public class GeckoSmsManager
   public final static int kNoError                = 0;
   public final static int kNoSignalError          = 1;
   public final static int kNotFoundError          = 2;
   public final static int kUnknownError           = 3;
   public final static int kInternalError          = 4;
   public final static int kNoSimCardError         = 5;
   public final static int kRadioDisabledError     = 6;
   public final static int kInvalidAddressError    = 7;
+  public final static int kFdnCheckError          = 8;
 
   private final static int kMaxMessageSize    = 160;
 
   private final static Uri kSmsContentUri     = Uri.parse("content://sms");
   private final static Uri kSmsSentContentUri = Uri.parse("content://sms/sent");
 
   private final static int kSmsTypeInbox      = 1;
   private final static int kSmsTypeSentbox    = 2;
--- a/mobile/android/base/GeckoSmsManager.java
+++ b/mobile/android/base/GeckoSmsManager.java
@@ -298,17 +298,17 @@ public class GeckoSmsManager
   public final static int kNoError             = 0;
   public final static int kNoSignalError       = 1;
   public final static int kNotFoundError       = 2;
   public final static int kUnknownError        = 3;
   public final static int kInternalError       = 4;
   public final static int kNoSimCardError      = 5;
   public final static int kRadioDisabledError  = 6;
   public final static int kInvalidAddressError = 7;
-
+  public final static int kFdnCheckError       = 8;
 
   private final static int kMaxMessageSize    = 160;
 
   private final static Uri kSmsContentUri     = Uri.parse("content://sms");
   private final static Uri kSmsSentContentUri = Uri.parse("content://sms/sent");
 
   private final static int kSmsTypeInbox      = 1;
   private final static int kSmsTypeSentbox    = 2;