зеркало из https://github.com/mozilla/gecko-dev.git
Bug 869841 - B2G MMS: Gaia cannot get request returned after calling .sendMMS(...). r=vicamo a=leo+
This commit is contained in:
Родитель
f042f8e0de
Коммит
c4e74c492d
|
@ -1077,7 +1077,8 @@ MmsService.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper function to broadcast the mms sent system message and notify observers.
|
* A helper function to broadcast system message and notify observers that
|
||||||
|
* an MMS is sent.
|
||||||
*
|
*
|
||||||
* @params aDomMessage
|
* @params aDomMessage
|
||||||
* The nsIDOMMozMmsMessage object.
|
* The nsIDOMMozMmsMessage object.
|
||||||
|
@ -1091,7 +1092,8 @@ MmsService.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper function to broadcast the mms received system message and notify observers.
|
* A helper function to broadcast system message and notify observers that
|
||||||
|
* an MMS is received.
|
||||||
*
|
*
|
||||||
* @params aDomMessage
|
* @params aDomMessage
|
||||||
* The nsIDOMMozMmsMessage object.
|
* The nsIDOMMozMmsMessage object.
|
||||||
|
@ -1100,7 +1102,7 @@ MmsService.prototype = {
|
||||||
// Broadcasting a 'sms-received' system message to open apps.
|
// Broadcasting a 'sms-received' system message to open apps.
|
||||||
this.broadcastMmsSystemMessage("sms-received", aDomMessage);
|
this.broadcastMmsSystemMessage("sms-received", aDomMessage);
|
||||||
|
|
||||||
// Notifying observers an MMS message is comming.
|
// Notifying observers an MMS message is received.
|
||||||
Services.obs.notifyObservers(aDomMessage, kSmsReceivedObserverTopic, null);
|
Services.obs.notifyObservers(aDomMessage, kSmsReceivedObserverTopic, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1142,6 +1144,12 @@ MmsService.prototype = {
|
||||||
gMobileMessageDatabaseService.saveReceivedMessage(savableMessage,
|
gMobileMessageDatabaseService.saveReceivedMessage(savableMessage,
|
||||||
(function (rv, domMessage) {
|
(function (rv, domMessage) {
|
||||||
let success = Components.isSuccessCode(rv);
|
let success = Components.isSuccessCode(rv);
|
||||||
|
|
||||||
|
// Cite 6.2.1 "Transaction Flow" in OMA-TS-MMS_ENC-V1_3-20110913-A:
|
||||||
|
// The M-NotifyResp.ind response PDU SHALL provide a message retrieval
|
||||||
|
// status code. The status ‘retrieved’ SHALL be used only if the MMS
|
||||||
|
// Client has successfully retrieved the MM prior to sending the
|
||||||
|
// NotifyResp.ind response PDU.
|
||||||
let transaction =
|
let transaction =
|
||||||
new NotifyResponseTransaction(transactionId,
|
new NotifyResponseTransaction(transactionId,
|
||||||
success ? MMS.MMS_PDU_STATUS_RETRIEVED
|
success ? MMS.MMS_PDU_STATUS_RETRIEVED
|
||||||
|
@ -1219,7 +1227,10 @@ MmsService.prototype = {
|
||||||
|
|
||||||
// For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not
|
// For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not
|
||||||
// roaming, proceed to retrieve MMS.
|
// roaming, proceed to retrieve MMS.
|
||||||
this.retrieveMessage(url, this.retrieveMessageCallback.bind(this, wish, savableMessage));
|
this.retrieveMessage(url,
|
||||||
|
this.retrieveMessageCallback.bind(this,
|
||||||
|
wish,
|
||||||
|
savableMessage));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1389,7 +1400,11 @@ MmsService.prototype = {
|
||||||
|
|
||||||
if (DEBUG) debug("Send MMS successful. aParams.receivers = " +
|
if (DEBUG) debug("Send MMS successful. aParams.receivers = " +
|
||||||
JSON.stringify(aParams.receivers));
|
JSON.stringify(aParams.receivers));
|
||||||
self.broadcastSentMessageEvent(domMessage);
|
|
||||||
|
// Notifying observers the MMS message is sent.
|
||||||
|
self.broadcastSentMessageEvent(aDomMessage);
|
||||||
|
|
||||||
|
// Return the request after sending the MMS message successfully.
|
||||||
aRequest.notifyMessageSent(aDomMessage);
|
aRequest.notifyMessageSent(aDomMessage);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1490,9 +1505,18 @@ MmsService.prototype = {
|
||||||
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
|
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notifying observers a new MMS message is retrieved.
|
// Notifying observers a new MMS message is retrieved.
|
||||||
aRequest.notifyMessageGot(domMessage);
|
|
||||||
this.broadcastReceivedMessageEvent(domMessage);
|
this.broadcastReceivedMessageEvent(domMessage);
|
||||||
|
|
||||||
|
// Return the request after retrieving the MMS message successfully.
|
||||||
|
aRequest.notifyMessageGot(domMessage);
|
||||||
|
|
||||||
|
// Cite 6.3.1 "Transaction Flow" in OMA-TS-MMS_ENC-V1_3-20110913-A:
|
||||||
|
// If an acknowledgement is requested, the MMS Client SHALL respond
|
||||||
|
// with an M-Acknowledge.ind PDU to the MMS Proxy-Relay that supports
|
||||||
|
// the specific MMS Client. The M-Acknowledge.ind PDU confirms
|
||||||
|
// successful message retrieval to the MMS Proxy Relay.
|
||||||
let transaction = new AcknowledgeTransaction(transactionId, reportAllowed);
|
let transaction = new AcknowledgeTransaction(transactionId, reportAllowed);
|
||||||
transaction.run();
|
transaction.run();
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче