зеркало из https://github.com/mozilla/gecko-dev.git
Bug 962977 - Unable to remove WAP push/SMS message from notification bar unless pressing "clear all" button or reboot device. r=gwagner
This commit is contained in:
Родитель
1a3fe57800
Коммит
f09b788952
|
@ -140,10 +140,20 @@ let NotificationDB = {
|
|||
receiveMessage: function(message) {
|
||||
if (DEBUG) { debug("Received message:" + message.name); }
|
||||
|
||||
// sendAsyncMessage can fail if the child process exits during a
|
||||
// notification storage operation, so always wrap it in a try/catch.
|
||||
function returnMessage(name, data) {
|
||||
try {
|
||||
message.target.sendAsyncMessage(name, data);
|
||||
} catch (e) {
|
||||
if (DEBUG) { debug("Return message failed, " + name); }
|
||||
}
|
||||
}
|
||||
|
||||
switch (message.name) {
|
||||
case "Notification:GetAll":
|
||||
this.queueTask("getall", message.data, function(notifications) {
|
||||
message.target.sendAsyncMessage("Notification:GetAll:Return:OK", {
|
||||
returnMessage("Notification:GetAll:Return:OK", {
|
||||
requestID: message.data.requestID,
|
||||
notifications: notifications
|
||||
});
|
||||
|
@ -152,7 +162,7 @@ let NotificationDB = {
|
|||
|
||||
case "Notification:Save":
|
||||
this.queueTask("save", message.data, function() {
|
||||
message.target.sendAsyncMessage("Notification:Save:Return:OK", {
|
||||
returnMessage("Notification:Save:Return:OK", {
|
||||
requestID: message.data.requestID
|
||||
});
|
||||
});
|
||||
|
@ -160,7 +170,7 @@ let NotificationDB = {
|
|||
|
||||
case "Notification:Delete":
|
||||
this.queueTask("delete", message.data, function() {
|
||||
message.target.sendAsyncMessage("Notification:Delete:Return:OK", {
|
||||
returnMessage("Notification:Delete:Return:OK", {
|
||||
requestID: message.data.requestID
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче