Bug 1175430 - Expose Network-Specific Error Cause for Various Error Handling in App Layer. r=btseng
authoryounghwan.ji <younghwan.ji@gmail.com>
Mon, 10 Aug 2015 10:08:23 +0900
changeset 257103 93db1a349ab9e8a84750e9a92bf21f2fea861c18
parent 257102 2a245e28985039efc1c29585fb3e874edb114ca9
child 257104 a29e9b59c7f5343d815907f0ba72f740396facb2
push id63526
push userkwierso@gmail.com
push dateMon, 10 Aug 2015 22:02:03 +0000
treeherdermozilla-inbound@c4ab17503c09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtseng
bugs1175430
milestone42.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 1175430 - Expose Network-Specific Error Cause for Various Error Handling in App Layer. r=btseng
dom/mobilemessage/MobileMessageCallback.cpp
dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
embedding/android/GeckoSmsManager.java
mobile/android/base/GeckoSmsManager.java
--- a/dom/mobilemessage/MobileMessageCallback.cpp
+++ b/dom/mobilemessage/MobileMessageCallback.cpp
@@ -57,16 +57,34 @@ ConvertErrorCodeToErrorString(int32_t aE
       errorStr = NS_LITERAL_STRING("NonActiveSimCardError");
       break;
     case nsIMobileMessageCallback::STORAGE_FULL_ERROR:
       errorStr = NS_LITERAL_STRING("StorageFullError");
       break;
     case nsIMobileMessageCallback::SIM_NOT_MATCHED_ERROR:
       errorStr = NS_LITERAL_STRING("SimNotMatchedError");
       break;
+    case nsIMobileMessageCallback::NETWORK_PROBLEMS_ERROR:
+      errorStr = NS_LITERAL_STRING("NetworkProblemsError");
+      break;
+    case nsIMobileMessageCallback::GENERAL_PROBLEMS_ERROR:
+      errorStr = NS_LITERAL_STRING("GeneralProblemsError");
+      break;
+    case nsIMobileMessageCallback::SERVICE_NOT_AVAILABLE_ERROR:
+      errorStr = NS_LITERAL_STRING("ServiceNotAvailableError");
+      break;
+    case nsIMobileMessageCallback::MESSAGE_TOO_LONG_FOR_NETWORK_ERROR:
+      errorStr = NS_LITERAL_STRING("MessageTooLongForNetworkError");
+      break;
+    case nsIMobileMessageCallback::SERVICE_NOT_SUPPORTED_ERROR:
+      errorStr = NS_LITERAL_STRING("ServiceNotSupportedError");
+      break;
+    case nsIMobileMessageCallback::RETRY_REQUIRED_ERROR:
+      errorStr = NS_LITERAL_STRING("RetryRequiredError");
+      break;
     default: // SUCCESS_NO_ERROR is handled above.
       MOZ_CRASH("Should never get here!");
   }
 
   return errorStr;
 }
 
 NS_IMPL_ADDREF(MobileMessageCallback)
--- a/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
+++ b/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
@@ -1,15 +1,15 @@
 /* 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(609692b0-1fc7-404a-91c4-eb2ec4d16c20)]
+[scriptable, uuid(19b24f93-7c02-4acf-addd-2f53bbb4e3fd)]
 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;
@@ -19,16 +19,22 @@ interface nsIMobileMessageCallback : nsI
   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;
   const unsigned short NON_ACTIVE_SIM_CARD_ERROR = 9;
   const unsigned short STORAGE_FULL_ERROR        = 10;
   const unsigned short SIM_NOT_MATCHED_ERROR     = 11;
+  const unsigned short NETWORK_PROBLEMS_ERROR    = 12;
+  const unsigned short GENERAL_PROBLEMS_ERROR    = 13;
+  const unsigned short SERVICE_NOT_AVAILABLE_ERROR          = 14;
+  const unsigned short MESSAGE_TOO_LONG_FOR_NETWORK_ERROR   = 15;
+  const unsigned short SERVICE_NOT_SUPPORTED_ERROR          = 16;
+  const unsigned short RETRY_REQUIRED_ERROR      = 17;
 
   /**
    * |message| can be nsIDOMMoz{Mms,Sms}Message.
    */
   void notifyMessageSent(in nsISupports message);
   void notifySendMessageFailed(in long error, in nsISupports message);
 
   /**
--- a/embedding/android/GeckoSmsManager.java
+++ b/embedding/android/GeckoSmsManager.java
@@ -308,16 +308,22 @@ public class GeckoSmsManager
   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;
   public final static int kNonActiveSimCardError = 9;
   public final static int kStorageFullError      = 10;
   public final static int kSimNotMatchedError    = 11;
+  public final static int kNetworkProblemsError = 12;
+  public final static int kGeneralProblemsError = 13;
+  public final static int kServiceNotAvailableError      = 14;
+  public final static int kMessageTooLongForNetworkError = 15;
+  public final static int kServiceNotSupportedError      = 16;
+  public final static int kRetryRequiredError   = 17;
 
   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
@@ -291,16 +291,22 @@ public class GeckoSmsManager
   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;
   public final static int kNonActiveSimCardError = 9;
   public final static int kStorageFullError      = 10;
   public final static int kSimNotMatchedError    = 11;
+  public final static int kNetworkProblemsError = 12;
+  public final static int kGeneralProblemsError = 13;
+  public final static int kServiceNotAvailableError      = 14;
+  public final static int kMessageTooLongForNetworkError = 15;
+  public final static int kServiceNotSupportedError      = 16;
+  public final static int kRetryRequiredError   = 17;
 
   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;