From 4cc178f86f56e85e2c5ea8298e5e4e44c05593b6 Mon Sep 17 00:00:00 2001 From: Gene Lian Date: Mon, 9 Sep 2013 21:48:07 +0800 Subject: [PATCH] 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 | 3 ++- dom/mobilemessage/src/MobileMessageCallback.cpp | 3 +++ dom/system/gonk/RadioInterfaceLayer.js | 3 +++ embedding/android/GeckoSmsManager.java | 1 + mobile/android/base/GeckoSmsManager.java | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl b/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl index 85cd690aadc..e509e33ea3e 100644 --- a/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl +++ b/dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl @@ -14,7 +14,7 @@ dictionary SmsThreadListItem unsigned long long unreadCount; }; -[scriptable, uuid(399125a8-00d2-11e3-8d12-3fba4465c097)] +[scriptable, uuid(5f82f826-1956-11e3-a2bb-9b043b33de27)] interface nsIMobileMessageCallback : nsISupports { /** @@ -30,6 +30,7 @@ interface nsIMobileMessageCallback : nsISupports 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. diff --git a/dom/mobilemessage/src/MobileMessageCallback.cpp b/dom/mobilemessage/src/MobileMessageCallback.cpp index b33ecd2ac69..a9ccb581a4b 100644 --- a/dom/mobilemessage/src/MobileMessageCallback.cpp +++ b/dom/mobilemessage/src/MobileMessageCallback.cpp @@ -104,6 +104,9 @@ MobileMessageCallback::NotifyError(int32_t aError, bool aAsync) 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!"); } diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 8e5e02b71f6..31b8383325d 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -2676,6 +2676,9 @@ RadioInterface.prototype = { 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) { diff --git a/embedding/android/GeckoSmsManager.java b/embedding/android/GeckoSmsManager.java index b7988a571be..6cfa5af5476 100644 --- a/embedding/android/GeckoSmsManager.java +++ b/embedding/android/GeckoSmsManager.java @@ -309,6 +309,7 @@ public class GeckoSmsManager 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; diff --git a/mobile/android/base/GeckoSmsManager.java b/mobile/android/base/GeckoSmsManager.java index ebd978836f7..dd9962953f0 100644 --- a/mobile/android/base/GeckoSmsManager.java +++ b/mobile/android/base/GeckoSmsManager.java @@ -303,7 +303,7 @@ public class GeckoSmsManager 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;