Bug 913436 - Gecko needs to return a proper error code when sending messages to non-FDN receivers. r=vicamo a=koi+
☠☠ backed out by 5b5b2b8f57f8 ☠ ☠
authorGene Lian <clian@mozilla.com>
Mon, 09 Sep 2013 21:00:45 +0800
changeset 159098 9f377abbf13e9749811e45a6650538d5de669222
parent 159097 aa991b7afb094c0a6b6f628461a80c4825e28306
child 159099 5b5b2b8f57f8cbccffb4a1f30b260776911f1474
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [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
@@ -25,16 +25,17 @@ interface nsIMobileMessageCallback : nsI
   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;