mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Backout 95752d95cf73, 190933b35023, 6834d09f8f09, 53e3e62c2b3d & f39ba5076599 (bug 797277) for xpcshell failures
This commit is contained in:
parent
3f935f12b2
commit
33a9c3c7a1
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(a82f9998-02a2-4db2-a0d1-f8353933d7b0)]
|
||||
[scriptable, builtinclass, uuid(5e3224dd-1ca3-43e6-861e-b7734656fd2f)]
|
||||
interface nsIDOMMozSmsMessage : nsISupports
|
||||
{
|
||||
// TODO: we should add SENT and RECEIVED DOMString constants, see bug 443316.
|
||||
@ -20,12 +20,6 @@ interface nsIDOMMozSmsMessage : nsISupports
|
||||
readonly attribute DOMString sender;
|
||||
readonly attribute DOMString receiver;
|
||||
readonly attribute DOMString body;
|
||||
|
||||
/**
|
||||
* Should be "normal", "class-0", "class-1", "class-2" or "class-3".
|
||||
*/
|
||||
readonly attribute DOMString messageClass;
|
||||
|
||||
[implicit_jscontext]
|
||||
readonly attribute jsval timestamp; // jsval is for Date.
|
||||
readonly attribute boolean read;
|
||||
|
@ -13,11 +13,11 @@
|
||||
|
||||
interface nsIDOMMozSmsFilter;
|
||||
|
||||
[scriptable, uuid(6fdb6007-51d0-456c-8b2e-dc0aea456298)]
|
||||
[scriptable, uuid(d6318c22-1ebd-4262-b991-432f61a96237)]
|
||||
interface nsISmsDatabaseService : nsISupports
|
||||
{
|
||||
// Takes some information required to save the message and returns its id.
|
||||
long saveReceivedMessage(in DOMString aSender, in DOMString aBody, in DOMString aMessageClass, in unsigned long long aDate);
|
||||
long saveReceivedMessage(in DOMString aSender, in DOMString aBody, in unsigned long long aDate);
|
||||
// Takes some information required to save the message and returns its id.
|
||||
long saveSentMessage(in DOMString aReceiver, in DOMString aBody, in unsigned long long aDate);
|
||||
void setMessageDeliveryStatus(in long aMessageId, in DOMString aDeliveryStatus);
|
||||
|
@ -11,7 +11,7 @@ interface nsIDOMMozSmsMessage;
|
||||
#define SMS_SERVICE_CONTRACTID "@mozilla.org/sms/smsservice;1"
|
||||
%}
|
||||
|
||||
[scriptable, builtinclass, uuid(9808dc00-33c6-45cc-a761-d1151cb192d6)]
|
||||
[scriptable, builtinclass, uuid(a1367149-c09f-4e8c-a890-5812406bed61)]
|
||||
interface nsISmsService : nsISupports
|
||||
{
|
||||
boolean hasSupport();
|
||||
@ -26,7 +26,6 @@ interface nsISmsService : nsISupports
|
||||
in DOMString sender,
|
||||
in DOMString receiver,
|
||||
in DOMString body,
|
||||
in DOMString messageClass,
|
||||
in jsval timestamp,
|
||||
in bool read);
|
||||
};
|
||||
|
@ -23,12 +23,6 @@ extern const char* kSmsDeliveryErrorObserverTopic; // Defined in the .cpp.
|
||||
#define DELIVERY_STATUS_PENDING NS_LITERAL_STRING("pending")
|
||||
#define DELIVERY_STATUS_ERROR NS_LITERAL_STRING("error")
|
||||
|
||||
#define MESSAGE_CLASS_NORMAL NS_LITERAL_STRING("normal")
|
||||
#define MESSAGE_CLASS_CLASS_0 NS_LITERAL_STRING("class-0")
|
||||
#define MESSAGE_CLASS_CLASS_1 NS_LITERAL_STRING("class-1")
|
||||
#define MESSAGE_CLASS_CLASS_2 NS_LITERAL_STRING("class-2")
|
||||
#define MESSAGE_CLASS_CLASS_3 NS_LITERAL_STRING("class-3")
|
||||
|
||||
} // namespace sms
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -30,11 +30,10 @@ SmsMessage::SmsMessage(int32_t aId,
|
||||
const nsString& aSender,
|
||||
const nsString& aReceiver,
|
||||
const nsString& aBody,
|
||||
MessageClass aMessageClass,
|
||||
uint64_t aTimestamp,
|
||||
bool aRead)
|
||||
: mData(aId, aDelivery, aDeliveryStatus, aSender, aReceiver, aBody,
|
||||
aMessageClass, aTimestamp, aRead)
|
||||
aTimestamp, aRead)
|
||||
{
|
||||
}
|
||||
|
||||
@ -50,7 +49,6 @@ SmsMessage::Create(int32_t aId,
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const jsval& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
@ -87,20 +85,6 @@ SmsMessage::Create(int32_t aId,
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (aMessageClass.Equals(MESSAGE_CLASS_NORMAL)) {
|
||||
data.messageClass() = eMessageClass_Normal;
|
||||
} else if (aMessageClass.Equals(MESSAGE_CLASS_CLASS_0)) {
|
||||
data.messageClass() = eMessageClass_Class0;
|
||||
} else if (aMessageClass.Equals(MESSAGE_CLASS_CLASS_1)) {
|
||||
data.messageClass() = eMessageClass_Class1;
|
||||
} else if (aMessageClass.Equals(MESSAGE_CLASS_CLASS_2)) {
|
||||
data.messageClass() = eMessageClass_Class2;
|
||||
} else if (aMessageClass.Equals(MESSAGE_CLASS_CLASS_3)) {
|
||||
data.messageClass() = eMessageClass_Class3;
|
||||
} else {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// We support both a Date object and a millisecond timestamp as a number.
|
||||
if (aTimestamp.isObject()) {
|
||||
JSObject& obj = aTimestamp.toObject();
|
||||
@ -203,33 +187,6 @@ SmsMessage::GetBody(nsAString& aBody)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SmsMessage::GetMessageClass(nsAString& aMessageClass)
|
||||
{
|
||||
switch (mData.messageClass()) {
|
||||
case eMessageClass_Normal:
|
||||
aMessageClass = MESSAGE_CLASS_NORMAL;
|
||||
break;
|
||||
case eMessageClass_Class0:
|
||||
aMessageClass = MESSAGE_CLASS_CLASS_0;
|
||||
break;
|
||||
case eMessageClass_Class1:
|
||||
aMessageClass = MESSAGE_CLASS_CLASS_1;
|
||||
break;
|
||||
case eMessageClass_Class2:
|
||||
aMessageClass = MESSAGE_CLASS_CLASS_2;
|
||||
break;
|
||||
case eMessageClass_Class3:
|
||||
aMessageClass = MESSAGE_CLASS_CLASS_3;
|
||||
break;
|
||||
default:
|
||||
MOZ_NOT_REACHED("We shouldn't get any other message class!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SmsMessage::GetTimestamp(JSContext* cx, jsval* aDate)
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
const nsString& aSender,
|
||||
const nsString& aReceiver,
|
||||
const nsString& aBody,
|
||||
MessageClass aMessageClass,
|
||||
uint64_t aTimestamp,
|
||||
bool aRead);
|
||||
SmsMessage(const SmsMessageData& aData);
|
||||
@ -40,7 +39,6 @@ public:
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const JS::Value& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
|
@ -42,17 +42,6 @@ enum ReadState {
|
||||
eReadState_EndGuard
|
||||
};
|
||||
|
||||
// For SmsFilterData.messageClass
|
||||
enum MessageClass {
|
||||
eMessageClass_Normal = 0,
|
||||
eMessageClass_Class0,
|
||||
eMessageClass_Class1,
|
||||
eMessageClass_Class2,
|
||||
eMessageClass_Class3,
|
||||
// This state should stay at the end.
|
||||
eMessageClass_EndGuard
|
||||
};
|
||||
|
||||
} // namespace sms
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
@ -89,16 +78,6 @@ struct ParamTraits<mozilla::dom::sms::ReadState>
|
||||
mozilla::dom::sms::eReadState_EndGuard>
|
||||
{};
|
||||
|
||||
/**
|
||||
* Message class serializer.
|
||||
*/
|
||||
template <>
|
||||
struct ParamTraits<mozilla::dom::sms::MessageClass>
|
||||
: public EnumSerializer<mozilla::dom::sms::MessageClass,
|
||||
mozilla::dom::sms::eMessageClass_Normal,
|
||||
mozilla::dom::sms::eMessageClass_EndGuard>
|
||||
{};
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
#endif // mozilla_dom_sms_Types_h
|
||||
|
@ -16,7 +16,6 @@ NS_IMPL_ISUPPORTS1(SmsDatabaseService, nsISmsDatabaseService)
|
||||
NS_IMETHODIMP
|
||||
SmsDatabaseService::SaveReceivedMessage(const nsAString& aSender,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
uint64_t aDate, int32_t* aId)
|
||||
{
|
||||
// The Android stock SMS app does this already.
|
||||
|
@ -53,7 +53,6 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const jsval& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
@ -61,7 +60,7 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
{
|
||||
return SmsMessage::Create(aId, aDelivery, aDeliveryStatus,
|
||||
aSender, aReceiver,
|
||||
aBody, aMessageClass, aTimestamp, aRead,
|
||||
aBody, aTimestamp, aRead,
|
||||
aCx, aMessage);
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,7 @@ NS_IMPL_ISUPPORTS1(SmsDatabaseService, nsISmsDatabaseService)
|
||||
NS_IMETHODIMP
|
||||
SmsDatabaseService::SaveReceivedMessage(const nsAString& aSender,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
uint64_t aDate,
|
||||
int32_t* aId)
|
||||
uint64_t aDate, int32_t* aId)
|
||||
{
|
||||
*aId = -1;
|
||||
NS_ERROR("We should not be here!");
|
||||
|
@ -43,7 +43,6 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const jsval& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
@ -51,7 +50,7 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
{
|
||||
return SmsMessage::Create(aId, aDelivery, aDeliveryStatus,
|
||||
aSender, aReceiver,
|
||||
aBody, aMessageClass, aTimestamp, aRead,
|
||||
aBody, aTimestamp, aRead,
|
||||
aCx, aMessage);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ include "mozilla/dom/sms/Types.h";
|
||||
|
||||
using DeliveryState;
|
||||
using DeliveryStatus;
|
||||
using MessageClass;
|
||||
using ReadState;
|
||||
|
||||
namespace mozilla {
|
||||
@ -23,7 +22,6 @@ struct SmsMessageData {
|
||||
nsString sender;
|
||||
nsString receiver;
|
||||
nsString body;
|
||||
MessageClass messageClass;
|
||||
uint64_t timestamp; // ms since epoch.
|
||||
bool read;
|
||||
};
|
||||
@ -89,7 +87,7 @@ parent:
|
||||
SendMessage(nsString aNumber, nsString aMessage, int32_t aRequestId,
|
||||
uint64_t aProcessId);
|
||||
|
||||
sync SaveReceivedMessage(nsString aSender, nsString aBody, nsString aMessageClass, uint64_t aDate)
|
||||
sync SaveReceivedMessage(nsString aSender, nsString aBody, uint64_t aDate)
|
||||
returns (int32_t aId);
|
||||
|
||||
sync SaveSentMessage(nsString aReceiver, nsString aBody, uint64_t aDate)
|
||||
|
@ -65,7 +65,6 @@ SmsIPCService::CreateSmsMessage(int32_t aId,
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const jsval& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
@ -73,7 +72,7 @@ SmsIPCService::CreateSmsMessage(int32_t aId,
|
||||
{
|
||||
return SmsMessage::Create(aId, aDelivery, aDeliveryStatus,
|
||||
aSender, aReceiver,
|
||||
aBody, aMessageClass, aTimestamp, aRead,
|
||||
aBody, aTimestamp, aRead,
|
||||
aCx, aMessage);
|
||||
}
|
||||
|
||||
@ -83,12 +82,10 @@ SmsIPCService::CreateSmsMessage(int32_t aId,
|
||||
NS_IMETHODIMP
|
||||
SmsIPCService::SaveReceivedMessage(const nsAString& aSender,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
uint64_t aDate,
|
||||
int32_t* aId)
|
||||
uint64_t aDate, int32_t* aId)
|
||||
{
|
||||
GetSmsChild()->SendSaveReceivedMessage(nsString(aSender), nsString(aBody),
|
||||
nsString(aMessageClass), aDate, aId);
|
||||
aDate, aId);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -162,9 +162,7 @@ SmsParent::RecvSendMessage(const nsString& aNumber, const nsString& aMessage,
|
||||
bool
|
||||
SmsParent::RecvSaveReceivedMessage(const nsString& aSender,
|
||||
const nsString& aBody,
|
||||
const nsString& aMessageClass,
|
||||
const uint64_t& aDate,
|
||||
int32_t* aId)
|
||||
const uint64_t& aDate, int32_t* aId)
|
||||
{
|
||||
*aId = -1;
|
||||
|
||||
@ -172,7 +170,7 @@ SmsParent::RecvSaveReceivedMessage(const nsString& aSender,
|
||||
do_GetService(SMS_DATABASE_SERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(smsDBService, true);
|
||||
|
||||
smsDBService->SaveReceivedMessage(aSender, aBody, aMessageClass, aDate, aId);
|
||||
smsDBService->SaveReceivedMessage(aSender, aBody, aDate, aId);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
virtual bool RecvHasSupport(bool* aHasSupport) MOZ_OVERRIDE;
|
||||
virtual bool RecvGetNumberOfMessagesForText(const nsString& aText, uint16_t* aResult) MOZ_OVERRIDE;
|
||||
virtual bool RecvSendMessage(const nsString& aNumber, const nsString& aMessage, const int32_t& aRequestId, const uint64_t& aProcessId) MOZ_OVERRIDE;
|
||||
virtual bool RecvSaveReceivedMessage(const nsString& aSender, const nsString& aBody, const nsString& aMessageClass, const uint64_t& aDate, int32_t* aId) MOZ_OVERRIDE;
|
||||
virtual bool RecvSaveReceivedMessage(const nsString& aSender, const nsString& aBody, const uint64_t& aDate, int32_t* aId) MOZ_OVERRIDE;
|
||||
virtual bool RecvSaveSentMessage(const nsString& aRecipient, const nsString& aBody, const uint64_t& aDate, int32_t* aId) MOZ_OVERRIDE;
|
||||
virtual bool RecvSetMessageDeliveryStatus(const int32_t& aMessageId, const nsString& aDeliveryStatus) MOZ_OVERRIDE;
|
||||
virtual bool RecvGetMessage(const int32_t& aMessageId, const int32_t& aRequestId, const uint64_t& aProcessId) MOZ_OVERRIDE;
|
||||
|
@ -25,8 +25,6 @@ const DELIVERY_STATUS_SUCCESS = "success";
|
||||
const DELIVERY_STATUS_PENDING = "pending";
|
||||
const DELIVERY_STATUS_ERROR = "error";
|
||||
|
||||
const MESSAGE_CLASS_NORMAL = "normal";
|
||||
|
||||
const FILTER_TIMESTAMP = "timestamp";
|
||||
const FILTER_NUMBERS = "numbers";
|
||||
const FILTER_DELIVERY = "delivery";
|
||||
@ -328,7 +326,6 @@ SmsDatabaseService.prototype = {
|
||||
message.sender,
|
||||
message.receiver,
|
||||
message.body,
|
||||
message.messageClass,
|
||||
message.timestamp,
|
||||
message.read);
|
||||
gSmsRequestManager.notifyCreateMessageList(requestId,
|
||||
@ -357,7 +354,7 @@ SmsDatabaseService.prototype = {
|
||||
* nsISmsDatabaseService API
|
||||
*/
|
||||
|
||||
saveReceivedMessage: function saveReceivedMessage(sender, body, messageClass, date) {
|
||||
saveReceivedMessage: function saveReceivedMessage(sender, body, date) {
|
||||
let receiver = this.mRIL.rilContext.icc ? this.mRIL.rilContext.icc.msisdn : null;
|
||||
|
||||
let message = {delivery: DELIVERY_RECEIVED,
|
||||
@ -365,7 +362,6 @@ SmsDatabaseService.prototype = {
|
||||
sender: sender,
|
||||
receiver: receiver,
|
||||
body: body,
|
||||
messageClass: messageClass,
|
||||
timestamp: date,
|
||||
read: FILTER_READ_UNREAD};
|
||||
return this.saveMessage(message);
|
||||
@ -379,7 +375,6 @@ SmsDatabaseService.prototype = {
|
||||
sender: sender,
|
||||
receiver: receiver,
|
||||
body: body,
|
||||
messageClass: MESSAGE_CLASS_NORMAL,
|
||||
timestamp: date,
|
||||
read: FILTER_READ_READ};
|
||||
return this.saveMessage(message);
|
||||
@ -474,7 +469,6 @@ SmsDatabaseService.prototype = {
|
||||
data.sender,
|
||||
data.receiver,
|
||||
data.body,
|
||||
data.messageClass,
|
||||
data.timestamp,
|
||||
data.read);
|
||||
gSmsRequestManager.notifyGotSms(requestId, message);
|
||||
@ -700,7 +694,6 @@ SmsDatabaseService.prototype = {
|
||||
message.sender,
|
||||
message.receiver,
|
||||
message.body,
|
||||
message.messageClass,
|
||||
message.timestamp,
|
||||
message.read);
|
||||
gSmsRequestManager.notifyGotNextMessage(requestId, sms);
|
||||
|
@ -68,7 +68,6 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
const nsAString& aSender,
|
||||
const nsAString& aReceiver,
|
||||
const nsAString& aBody,
|
||||
const nsAString& aMessageClass,
|
||||
const jsval& aTimestamp,
|
||||
const bool aRead,
|
||||
JSContext* aCx,
|
||||
@ -76,7 +75,7 @@ SmsService::CreateSmsMessage(int32_t aId,
|
||||
{
|
||||
return SmsMessage::Create(aId, aDelivery, aDeliveryStatus,
|
||||
aSender, aReceiver,
|
||||
aBody, aMessageClass, aTimestamp, aRead,
|
||||
aBody, aTimestamp, aRead,
|
||||
aCx, aMessage);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ function sendSmsPduToEmulator(pdu) {
|
||||
}
|
||||
|
||||
const TIMESTAMP = Date.UTC(2000, 0, 1);
|
||||
function checkMessage(message, id, messageClass) {
|
||||
function checkMessage(message, id) {
|
||||
ok(message instanceof MozSmsMessage,
|
||||
"message is instanceof " + message.constructor);
|
||||
if (id == null) {
|
||||
@ -43,7 +43,6 @@ function checkMessage(message, id, messageClass) {
|
||||
is(message.deliveryStatus, "success", "message.deliveryStatus");
|
||||
is(message.sender, "+1", "message.sender");
|
||||
is(message.body, "A", "message.body");
|
||||
is(message.messageClass, messageClass, "message.messageClass");
|
||||
ok(message.timestamp instanceof Date,
|
||||
"message.timestamp is instanceof " + message.timestamp.constructor);
|
||||
is(message.timestamp.getTime(), TIMESTAMP, "message.timestamp");
|
||||
@ -62,7 +61,7 @@ function test_message_class_0() {
|
||||
sms.removeEventListener("received", onReceived);
|
||||
|
||||
let message = event.message;
|
||||
checkMessage(message, -1, "class-0");
|
||||
checkMessage(message, -1);
|
||||
|
||||
// Make sure the message is not stored.
|
||||
let request = sms.getMessages(null, false);
|
||||
@ -101,13 +100,13 @@ function test_message_class_0() {
|
||||
do_test(0);
|
||||
}
|
||||
|
||||
function doTestMessageClassGeneric(allDCSs, messageClass, next) {
|
||||
function doTestMessageClassGeneric(allDCSs, next) {
|
||||
function do_test(dcsIndex) {
|
||||
sms.addEventListener("received", function onReceived(event) {
|
||||
sms.removeEventListener("received", onReceived);
|
||||
|
||||
// Make sure we can correctly receive the message
|
||||
checkMessage(event.message, null, messageClass);
|
||||
checkMessage(event.message);
|
||||
|
||||
++dcsIndex;
|
||||
if (dcsIndex >= allDCSs.length) {
|
||||
@ -136,7 +135,7 @@ function test_message_class_1() {
|
||||
];
|
||||
|
||||
log("Checking Message Class 1");
|
||||
doTestMessageClassGeneric(allDCSs, "class-1", test_message_class_2);
|
||||
doTestMessageClassGeneric(allDCSs, test_message_class_2);
|
||||
}
|
||||
|
||||
function test_message_class_2() {
|
||||
@ -157,7 +156,7 @@ function test_message_class_2() {
|
||||
function onReceived(event) {
|
||||
if (pidIndex == 0) {
|
||||
// Make sure we can correctly receive the message
|
||||
checkMessage(event.message, null, "class-2");
|
||||
checkMessage(event.message);
|
||||
|
||||
next();
|
||||
return;
|
||||
@ -221,7 +220,7 @@ function test_message_class_3() {
|
||||
];
|
||||
|
||||
log("Checking Message Class 3");
|
||||
doTestMessageClassGeneric(allDCSs, "class-3", cleanUp);
|
||||
doTestMessageClassGeneric(allDCSs, cleanUp);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -1230,10 +1230,9 @@ RadioInterfaceLayer.prototype = {
|
||||
}
|
||||
|
||||
let id = -1;
|
||||
if (message.messageClass != RIL.GECKO_SMS_MESSAGE_CLASSES[RIL.PDU_DCS_MSG_CLASS_0]) {
|
||||
if (message.messageClass != RIL.PDU_DCS_MSG_CLASS_0) {
|
||||
id = gSmsDatabaseService.saveReceivedMessage(message.sender || null,
|
||||
message.fullBody || null,
|
||||
message.messageClass,
|
||||
message.timestamp);
|
||||
}
|
||||
let sms = gSmsService.createSmsMessage(id,
|
||||
@ -1242,7 +1241,6 @@ RadioInterfaceLayer.prototype = {
|
||||
message.sender || null,
|
||||
message.receiver || null,
|
||||
message.fullBody || null,
|
||||
message.messageClass,
|
||||
message.timestamp,
|
||||
false);
|
||||
|
||||
@ -1253,7 +1251,6 @@ RadioInterfaceLayer.prototype = {
|
||||
sender: message.sender || null,
|
||||
receiver: message.receiver || null,
|
||||
body: message.fullBody || null,
|
||||
messageClass: message.messageClass,
|
||||
timestamp: message.timestamp,
|
||||
read: false});
|
||||
Services.obs.notifyObservers(sms, kSmsReceivedObserverTopic, null);
|
||||
@ -1283,7 +1280,6 @@ RadioInterfaceLayer.prototype = {
|
||||
}
|
||||
|
||||
let timestamp = Date.now();
|
||||
let messageClass = RIL.GECKO_SMS_MESSAGE_CLASSES[RIL.PDU_DCS_MSG_CLASS_NORMAL];
|
||||
let id = gSmsDatabaseService.saveSentMessage(options.number,
|
||||
options.fullBody,
|
||||
timestamp);
|
||||
@ -1293,7 +1289,6 @@ RadioInterfaceLayer.prototype = {
|
||||
null,
|
||||
options.number,
|
||||
options.fullBody,
|
||||
messageClass,
|
||||
timestamp,
|
||||
true);
|
||||
|
||||
@ -1319,7 +1314,6 @@ RadioInterfaceLayer.prototype = {
|
||||
}
|
||||
delete this._sentSmsEnvelopes[message.envelopeId];
|
||||
|
||||
let messageClass = RIL.GECKO_SMS_MESSAGE_CLASSES[RIL.PDU_DCS_MSG_CLASS_NORMAL];
|
||||
gSmsDatabaseService.setMessageDeliveryStatus(options.id,
|
||||
message.deliveryStatus);
|
||||
let sms = gSmsService.createSmsMessage(options.id,
|
||||
@ -1328,7 +1322,6 @@ RadioInterfaceLayer.prototype = {
|
||||
null,
|
||||
options.number,
|
||||
options.fullBody,
|
||||
messageClass,
|
||||
options.timestamp,
|
||||
true);
|
||||
|
||||
|
@ -964,11 +964,11 @@ const PDU_PID_USIM_DATA_DOWNLOAD = 0x7F;
|
||||
const PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00;
|
||||
const PDU_DCS_MSG_CODING_8BITS_ALPHABET = 0x04;
|
||||
const PDU_DCS_MSG_CODING_16BITS_ALPHABET = 0x08;
|
||||
const PDU_DCS_MSG_CLASS_NORMAL = 0xFF;
|
||||
const PDU_DCS_MSG_CLASS_UNKNOWN = 0xFF;
|
||||
const PDU_DCS_MSG_CLASS_0 = 0x00;
|
||||
const PDU_DCS_MSG_CLASS_1 = 0x01;
|
||||
const PDU_DCS_MSG_CLASS_2 = 0x02;
|
||||
const PDU_DCS_MSG_CLASS_3 = 0x03;
|
||||
const PDU_DCS_MSG_CLASS_ME_SPECIFIC = 0x01;
|
||||
const PDU_DCS_MSG_CLASS_SIM_SPECIFIC = 0x02;
|
||||
const PDU_DCS_MSG_CLASS_TE_SPECIFIC = 0x03;
|
||||
const PDU_DCS_CODING_GROUP_BITS = 0xF0;
|
||||
const PDU_DCS_MSG_CLASS_BITS = 0x03;
|
||||
const PDU_DCS_MWI_ACTIVE_BITS = 0x08;
|
||||
@ -979,13 +979,6 @@ const PDU_DCS_MWI_TYPE_FAX = 0x01;
|
||||
const PDU_DCS_MWI_TYPE_EMAIL = 0x02;
|
||||
const PDU_DCS_MWI_TYPE_OTHER = 0x03;
|
||||
|
||||
const GECKO_SMS_MESSAGE_CLASSES = {};
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL] = "normal";
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0] = "class-0";
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1] = "class-1";
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2] = "class-2";
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3] = "class-3";
|
||||
|
||||
// Because service center timestamp omit the century. Yay.
|
||||
const PDU_TIMESTAMP_YEAR_OFFSET = 2000;
|
||||
|
||||
|
@ -3751,7 +3751,7 @@ let RIL = {
|
||||
return PDU_FCS_OK;
|
||||
}
|
||||
|
||||
if (message.messageClass == GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]) {
|
||||
if (message.messageClass == PDU_DCS_MSG_CLASS_SIM_SPECIFIC) {
|
||||
switch (message.epid) {
|
||||
case PDU_PID_ANSI_136_R_DATA:
|
||||
case PDU_PID_USIM_DATA_DOWNLOAD:
|
||||
@ -3777,13 +3777,13 @@ let RIL = {
|
||||
}
|
||||
|
||||
// TODO: Bug 739143: B2G SMS: Support SMS Storage Full event
|
||||
if ((message.messageClass != GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]) && !true) {
|
||||
if ((message.messageClass != PDU_DCS_MSG_CLASS_0) && !true) {
|
||||
// `When a mobile terminated message is class 0..., the MS shall display
|
||||
// the message immediately and send a ACK to the SC ..., irrespective of
|
||||
// whether there is memory available in the (U)SIM or ME.` ~ 3GPP 23.038
|
||||
// clause 4.
|
||||
|
||||
if (message.messageClass == GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]) {
|
||||
if (message.messageClass == PDU_DCS_MSG_CLASS_SIM_SPECIFIC) {
|
||||
// `If all the short message storage at the MS is already in use, the
|
||||
// MS shall return "memory capacity exceeded".` ~ 3GPP 23.038 clause 4.
|
||||
return PDU_FCS_MEMORY_CAPACITY_EXCEEDED;
|
||||
@ -3809,7 +3809,7 @@ let RIL = {
|
||||
this.sendDOMMessage(message);
|
||||
}
|
||||
|
||||
if (message.messageClass == GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]) {
|
||||
if (message.messageClass == PDU_DCS_MSG_CLASS_SIM_SPECIFIC) {
|
||||
// `MS shall ensure that the message has been to the SMS data field in
|
||||
// the (U)SIM before sending an ACK to the SC.` ~ 3GPP 23.038 clause 4
|
||||
return PDU_FCS_RESERVED;
|
||||
@ -5925,7 +5925,7 @@ let GsmPDUHelper = {
|
||||
if (DEBUG) debug("PDU: read dcs: " + dcs);
|
||||
|
||||
// No message class by default.
|
||||
let messageClass = PDU_DCS_MSG_CLASS_NORMAL;
|
||||
let messageClass = PDU_DCS_MSG_CLASS_UNKNOWN;
|
||||
// 7 bit is the default fallback encoding.
|
||||
let encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
|
||||
switch (dcs & PDU_DCS_CODING_GROUP_BITS) {
|
||||
@ -6002,7 +6002,7 @@ let GsmPDUHelper = {
|
||||
|
||||
msg.dcs = dcs;
|
||||
msg.encoding = encoding;
|
||||
msg.messageClass = GECKO_SMS_MESSAGE_CLASSES[messageClass];
|
||||
msg.messageClass = messageClass;
|
||||
|
||||
if (DEBUG) debug("PDU: message encoding is " + encoding + " bit.");
|
||||
},
|
||||
|
@ -106,106 +106,72 @@ add_test(function test_GsmPDUHelper_readDataCodingScheme() {
|
||||
|
||||
// Group 00xx
|
||||
// Bit 3 and 2 indicate the character set being used.
|
||||
test_dcs(0x00, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x04, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x08, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x0C, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x00, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x04, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x08, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x0C, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
// Bit 4, if set to 0, indicates that bits 1 to 0 are reserved and have no
|
||||
// message class meaning.
|
||||
test_dcs(0x01, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x02, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x03, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x01, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x02, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x03, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
// Bit 4, if set to 1, indicates that bits 1 to 0 have a message class meaning.
|
||||
test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
|
||||
test_dcs(0x11, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
|
||||
test_dcs(0x12, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
|
||||
test_dcs(0x13, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
|
||||
test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
|
||||
test_dcs(0x11, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
|
||||
test_dcs(0x12, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
|
||||
test_dcs(0x13, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
|
||||
|
||||
// Group 01xx
|
||||
test_dcs(0x50, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
|
||||
test_dcs(0x50, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
|
||||
|
||||
// Group 1000..1011: reserved
|
||||
test_dcs(0x8F, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x9F, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0xAF, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0xBF, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
|
||||
test_dcs(0x8F, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0x9F, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0xAF, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
test_dcs(0xBF, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
|
||||
|
||||
// Group 1100: Message Waiting Indication Group: Discard Message
|
||||
// Bit 3 indicates Indication Sense:
|
||||
test_dcs(0xC0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xC0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: false, discard: true, msgCount: 0});
|
||||
test_dcs(0xC8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xC8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: true, msgCount: -1});
|
||||
// Bit 2 is reserved, and set to 0:
|
||||
test_dcs(0xCC, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xCC, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: true, msgCount: -1});
|
||||
|
||||
// Group 1101: Message Waiting Indication Group: Store Message
|
||||
// Bit 3 indicates Indication Sense:
|
||||
test_dcs(0xD0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xD0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: false, discard: false, msgCount: 0});
|
||||
test_dcs(0xD8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xD8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: false, msgCount: -1});
|
||||
// Bit 2 is reserved, and set to 0:
|
||||
test_dcs(0xDC, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xDC, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: false, msgCount: -1});
|
||||
|
||||
// Group 1110: Message Waiting Indication Group: Store Message, UCS2
|
||||
// Bit 3 indicates Indication Sense:
|
||||
test_dcs(0xE0, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xE0, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: false, discard: false, msgCount: 0});
|
||||
test_dcs(0xE8, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xE8, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: false, msgCount: -1});
|
||||
// Bit 2 is reserved, and set to 0:
|
||||
test_dcs(0xEC, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
|
||||
test_dcs(0xEC, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
|
||||
{active: true, discard: false, msgCount: -1});
|
||||
|
||||
// Group 1111
|
||||
test_dcs(0xF0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
|
||||
test_dcs(0xF1, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
|
||||
test_dcs(0xF2, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
|
||||
test_dcs(0xF3, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
|
||||
test_dcs(0xF4, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
|
||||
test_dcs(0xF5, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
|
||||
test_dcs(0xF6, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
|
||||
test_dcs(0xF7, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
|
||||
test_dcs(0xF0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
|
||||
test_dcs(0xF1, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
|
||||
test_dcs(0xF2, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
|
||||
test_dcs(0xF3, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
|
||||
test_dcs(0xF4, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
|
||||
test_dcs(0xF5, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
|
||||
test_dcs(0xF6, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
|
||||
test_dcs(0xF7, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
|
||||
// Bit 3 is reserved and should be set to 0, but if it doesn't we should
|
||||
// ignore it.
|
||||
test_dcs(0xF8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
|
||||
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
|
||||
test_dcs(0xF8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
@ -89,7 +89,7 @@ public class GeckoAppShell
|
||||
|
||||
public static native void notifyBatteryChange(double aLevel, boolean aCharging, double aRemainingTime);
|
||||
|
||||
public static native void notifySmsReceived(String aSender, String aBody, int aMessageClass, long aTimestamp);
|
||||
public static native void notifySmsReceived(String aSender, String aBody, long aTimestamp);
|
||||
public static native int saveMessageInSentbox(String aReceiver, String aBody, long aTimestamp);
|
||||
public static native void notifySmsSent(int aId, String aReceiver, String aBody, long aTimestamp, int aRequestId, long aProcessId);
|
||||
public static native void notifySmsDelivery(int aId, int aDeliveryStatus, String aReceiver, String aBody, long aTimestamp);
|
||||
|
@ -32,8 +32,6 @@ import android.os.Looper;
|
||||
import android.telephony.SmsManager;
|
||||
import android.telephony.SmsMessage;
|
||||
|
||||
import static android.telephony.SmsMessage.MessageClass;
|
||||
|
||||
/**
|
||||
* This class is returning unique ids for PendingIntent requestCode attribute.
|
||||
* There are only |Integer.MAX_VALUE - Integer.MIN_VALUE| unique IDs available,
|
||||
@ -342,16 +340,6 @@ public class GeckoSmsManager
|
||||
private final static int kInternalDeliveryStatusPending = 32;
|
||||
private final static int kInternalDeliveryStatusFailed = 64;
|
||||
|
||||
/*
|
||||
* Keep the following values in sync with |MessageClass| in:
|
||||
* dom/sms/src/Types.h
|
||||
*/
|
||||
private final static int kMessageClassNormal = 0;
|
||||
private final static int kMessageClassClass0 = 1;
|
||||
private final static int kMessageClassClass1 = 2;
|
||||
private final static int kMessageClassClass2 = 3;
|
||||
private final static int kMessageClassClass3 = 4;
|
||||
|
||||
private final static String[] kRequiredMessageRows = new String[] { "_id", "address", "body", "date", "type", "status" };
|
||||
|
||||
public GeckoSmsManager() {
|
||||
@ -389,7 +377,6 @@ public class GeckoSmsManager
|
||||
|
||||
GeckoAppShell.notifySmsReceived(msg.getDisplayOriginatingAddress(),
|
||||
msg.getDisplayMessageBody(),
|
||||
getGeckoMessageClass(msg.getMessageClass()),
|
||||
System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@ -952,21 +939,6 @@ public class GeckoSmsManager
|
||||
return kDeliveryStatusSuccess;
|
||||
}
|
||||
|
||||
private int getGeckoMessageClass(MessageClass aMessageClass) {
|
||||
switch (aMessageClass) {
|
||||
case UNKNOWN:
|
||||
return kMessageClassNormal;
|
||||
case CLASS_0:
|
||||
return kMessageClassClass0;
|
||||
case CLASS_1:
|
||||
return kMessageClassClass1;
|
||||
case CLASS_2:
|
||||
return kMessageClassClass2;
|
||||
case CLASS_3:
|
||||
return kMessageClassClass3;
|
||||
}
|
||||
}
|
||||
|
||||
class IdTooHighException extends Exception {
|
||||
private static final long serialVersionUID = 395697882128640L;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ public class GeckoAppShell
|
||||
|
||||
public static native void notifyBatteryChange(double aLevel, boolean aCharging, double aRemainingTime);
|
||||
|
||||
public static native void notifySmsReceived(String aSender, String aBody, int aMessageClass, long aTimestamp);
|
||||
public static native void notifySmsReceived(String aSender, String aBody, long aTimestamp);
|
||||
public static native int saveMessageInSentbox(String aReceiver, String aBody, long aTimestamp);
|
||||
public static native void notifySmsSent(int aId, String aReceiver, String aBody, long aTimestamp, int aRequestId, long aProcessId);
|
||||
public static native void notifySmsDelivery(int aId, int aDeliveryStatus, String aReceiver, String aBody, long aTimestamp);
|
||||
|
@ -25,8 +25,6 @@ import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static android.telephony.SmsMessage.MessageClass;
|
||||
|
||||
/**
|
||||
* This class is returning unique ids for PendingIntent requestCode attribute.
|
||||
* There are only |Integer.MAX_VALUE - Integer.MIN_VALUE| unique IDs available,
|
||||
@ -335,16 +333,6 @@ public class GeckoSmsManager
|
||||
private final static int kInternalDeliveryStatusPending = 32;
|
||||
private final static int kInternalDeliveryStatusFailed = 64;
|
||||
|
||||
/*
|
||||
* Keep the following values in sync with |MessageClass| in:
|
||||
* dom/sms/src/Types.h
|
||||
*/
|
||||
private final static int kMessageClassNormal = 0;
|
||||
private final static int kMessageClassClass0 = 1;
|
||||
private final static int kMessageClassClass1 = 2;
|
||||
private final static int kMessageClassClass2 = 3;
|
||||
private final static int kMessageClassClass3 = 4;
|
||||
|
||||
private final static String[] kRequiredMessageRows = new String[] { "_id", "address", "body", "date", "type", "status" };
|
||||
|
||||
public GeckoSmsManager() {
|
||||
@ -382,7 +370,6 @@ public class GeckoSmsManager
|
||||
|
||||
GeckoAppShell.notifySmsReceived(msg.getDisplayOriginatingAddress(),
|
||||
msg.getDisplayMessageBody(),
|
||||
getGeckoMessageClass(msg.getMessageClass()),
|
||||
System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@ -945,21 +932,6 @@ public class GeckoSmsManager
|
||||
return kDeliveryStatusSuccess;
|
||||
}
|
||||
|
||||
private int getGeckoMessageClass(MessageClass aMessageClass) {
|
||||
switch (aMessageClass) {
|
||||
case UNKNOWN:
|
||||
return kMessageClassNormal;
|
||||
case CLASS_0:
|
||||
return kMessageClassClass0;
|
||||
case CLASS_1:
|
||||
return kMessageClassClass1;
|
||||
case CLASS_2:
|
||||
return kMessageClassClass2;
|
||||
case CLASS_3:
|
||||
return kMessageClassClass3;
|
||||
}
|
||||
}
|
||||
|
||||
class IdTooHighException extends Exception {
|
||||
private static final long serialVersionUID = 29935575131092050L;
|
||||
}
|
||||
|
@ -186,7 +186,6 @@ NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_notifySmsReceived(JNIEnv* jenv, jclass,
|
||||
jstring aSender,
|
||||
jstring aBody,
|
||||
jint aMessageClass,
|
||||
jlong aTimestamp)
|
||||
{
|
||||
class NotifySmsReceivedRunnable : public nsRunnable {
|
||||
@ -212,9 +211,7 @@ Java_org_mozilla_gecko_GeckoAppShell_notifySmsReceived(JNIEnv* jenv, jclass,
|
||||
|
||||
SmsMessageData message(0, eDeliveryState_Received, eDeliveryStatus_Success,
|
||||
nsJNIString(aSender, jenv), EmptyString(),
|
||||
nsJNIString(aBody, jenv),
|
||||
static_cast<MessageClass>(aMessageClass),
|
||||
aTimestamp, false);
|
||||
nsJNIString(aBody, jenv), aTimestamp, false);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable = new NotifySmsReceivedRunnable(message);
|
||||
NS_DispatchToMainThread(runnable);
|
||||
@ -298,11 +295,9 @@ Java_org_mozilla_gecko_GeckoAppShell_notifySmsSent(JNIEnv* jenv, jclass,
|
||||
uint64_t mProcessId;
|
||||
};
|
||||
|
||||
// TODO Need to add the message `messageClass` parameter value. Bug 804476
|
||||
SmsMessageData message(aId, eDeliveryState_Sent, eDeliveryStatus_Pending,
|
||||
EmptyString(), nsJNIString(aReceiver, jenv),
|
||||
nsJNIString(aBody, jenv), eMessageClass_Normal,
|
||||
aTimestamp, true);
|
||||
nsJNIString(aBody, jenv), aTimestamp, true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable = new NotifySmsSentRunnable(message, aRequestId, aProcessId);
|
||||
NS_DispatchToMainThread(runnable);
|
||||
@ -341,12 +336,10 @@ Java_org_mozilla_gecko_GeckoAppShell_notifySmsDelivery(JNIEnv* jenv, jclass,
|
||||
SmsMessageData mMessageData;
|
||||
};
|
||||
|
||||
// TODO Need to add the message `messageClass` parameter value. Bug 804476
|
||||
SmsMessageData message(aId, eDeliveryState_Sent,
|
||||
static_cast<DeliveryStatus>(aDeliveryStatus),
|
||||
EmptyString(), nsJNIString(aReceiver, jenv),
|
||||
nsJNIString(aBody, jenv), eMessageClass_Normal,
|
||||
aTimestamp, true);
|
||||
nsJNIString(aBody, jenv), aTimestamp, true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable = new NotifySmsDeliveredRunnable(message);
|
||||
NS_DispatchToMainThread(runnable);
|
||||
@ -454,12 +447,10 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGetSms(JNIEnv* jenv, jclass,
|
||||
: eDeliveryState_Sent;
|
||||
|
||||
// TODO Need to add the message `read` parameter value. Bug 748391
|
||||
// TODO Need to add the message `messageClass` parameter value. Bug 804476
|
||||
SmsMessageData message(aId, state,
|
||||
static_cast<DeliveryStatus>(aDeliveryStatus),
|
||||
nsJNIString(aSender, jenv), receiver,
|
||||
nsJNIString(aBody, jenv), eMessageClass_Normal,
|
||||
aTimestamp, true);
|
||||
nsJNIString(aBody, jenv), aTimestamp, true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable = new NotifyGetSmsRunnable(message, aRequestId, aProcessId);
|
||||
NS_DispatchToMainThread(runnable);
|
||||
@ -715,12 +706,10 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyListCreated(JNIEnv* jenv, jclass,
|
||||
: eDeliveryState_Sent;
|
||||
|
||||
// TODO Need to add the message `read` parameter value. Bug 748391
|
||||
// TODO Need to add the message `messageClass` parameter value. Bug 804476
|
||||
SmsMessageData message(aMessageId, state,
|
||||
static_cast<DeliveryStatus>(aDeliveryStatus),
|
||||
nsJNIString(aSender, jenv), receiver,
|
||||
nsJNIString(aBody, jenv), eMessageClass_Normal,
|
||||
aTimestamp, true);
|
||||
nsJNIString(aBody, jenv), aTimestamp, true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new NotifyCreateMessageListRunnable(aListId, message, aRequestId, aProcessId);
|
||||
@ -781,12 +770,10 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGotNextMessage(JNIEnv* jenv, jclass,
|
||||
: eDeliveryState_Sent;
|
||||
|
||||
// TODO Need to add the message `read` parameter value. Bug 748391
|
||||
// TODO Need to add the message `messageClass` parameter value. Bug 804476
|
||||
SmsMessageData message(aMessageId, state,
|
||||
static_cast<DeliveryStatus>(aDeliveryStatus),
|
||||
nsJNIString(aSender, jenv), receiver,
|
||||
nsJNIString(aBody, jenv), eMessageClass_Normal,
|
||||
aTimestamp, true);
|
||||
nsJNIString(aBody, jenv), aTimestamp, true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new NotifyGotNextMessageRunnable(message, aRequestId, aProcessId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user