mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1138264 - Part 1: Define new system messages of "sms-failed" and "sms-delivery-error". r=echen
This commit is contained in:
parent
f9e255a46b
commit
37699fa7da
@ -88,6 +88,9 @@ this.SystemMessagePermissionsTable = {
|
||||
"sms-delivery-success": {
|
||||
"sms": []
|
||||
},
|
||||
"sms-delivery-error": {
|
||||
"sms": []
|
||||
},
|
||||
"sms-read-success": {
|
||||
"sms": []
|
||||
},
|
||||
@ -97,6 +100,9 @@ this.SystemMessagePermissionsTable = {
|
||||
"sms-sent": {
|
||||
"sms": []
|
||||
},
|
||||
"sms-failed": {
|
||||
"sms": []
|
||||
},
|
||||
"telephony-new-call": {
|
||||
"telephony": []
|
||||
},
|
||||
|
@ -16,7 +16,8 @@ interface nsISmsMessenger : nsISupports
|
||||
const unsigned short NOTIFICATION_TYPE_DELIVERY_SUCCESS = 2;
|
||||
|
||||
/**
|
||||
* To broadcast 'sms-received', 'sms-delivery-success', 'sms-sent' system message
|
||||
* To broadcast system messages of 'sms-received', 'sms-delivery-success',
|
||||
* 'sms-sent', 'sms-failed' and 'sms-delivery-error'.
|
||||
*
|
||||
* Note: Except aNotificationType, all parameters are the attributes of the
|
||||
* nsIDOMMozSmsMessage generated by nsIMobileMessageService.createSmsMessage().
|
||||
@ -67,3 +68,12 @@ interface nsISmsMessenger : nsISupports
|
||||
in DOMTimeStamp aDeliveryTimestamp,
|
||||
in boolean aRead);
|
||||
};
|
||||
|
||||
[scriptable, uuid(1e293188-d845-11e4-bc92-af2bf0a70344)]
|
||||
interface nsISmsMessenger_new : nsISmsMessenger
|
||||
{
|
||||
/* 'sms-failed' system message */
|
||||
const unsigned short NOTIFICATION_TYPE_SENT_FAILED = 3;
|
||||
/* 'sms-delivery-error' system message */
|
||||
const unsigned short NOTIFICATION_TYPE_DELIVERY_ERROR = 4;
|
||||
};
|
||||
|
@ -84,13 +84,19 @@ RILSystemMessenger.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper to send 'sms-received', 'sms-delivery-success', 'sms-sent' system message.
|
||||
* Wrapper to send 'sms-received', 'sms-delivery-success', 'sms-sent',
|
||||
* 'sms-failed', 'sms-delivery-error' system message.
|
||||
*/
|
||||
notifySms: function(aNotificationType, aId, aThreadId, aIccId, aDelivery,
|
||||
aDeliveryStatus, aSender, aReceiver, aBody, aMessageClass,
|
||||
aTimestamp, aSentTimestamp, aDeliveryTimestamp, aRead) {
|
||||
let msgType =
|
||||
["sms-received", "sms-sent", "sms-delivery-success"][aNotificationType];
|
||||
let msgType = [
|
||||
"sms-received",
|
||||
"sms-sent",
|
||||
"sms-delivery-success",
|
||||
"sms-failed",
|
||||
"sms-delivery-error"
|
||||
][aNotificationType];
|
||||
|
||||
if (!msgType) {
|
||||
throw new Error("Invalid Notification Type: " + aNotificationType);
|
||||
|
@ -51,6 +51,7 @@ RILSystemMessengerHelper.prototype = {
|
||||
classID: RILSYSTEMMESSENGERHELPER_CID,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyMessenger,
|
||||
Ci.nsISmsMessenger,
|
||||
Ci.nsISmsMessenger_new,
|
||||
Ci.nsICellbroadcastMessenger,
|
||||
Ci.nsIMobileConnectionMessenger,
|
||||
Ci.nsIIccMessenger]),
|
||||
|
Loading…
Reference in New Issue
Block a user