Bug 1100285 - sessionId shouldn't be added in nfc-manager-send-file. r=dimi

This commit is contained in:
Yoshi Huang 2014-11-17 18:51:40 +08:00
parent 87398db1ad
commit 6f58df1cee

View File

@ -599,13 +599,14 @@ Nfc.prototype = {
*/
receiveMessage: function receiveMessage(message) {
let isRFAPI = message.name == "NFC:ChangeRFState";
if (!isRFAPI) {
if (this.rfState != NFC.NFC_RF_STATE_DISCOVERY) {
debug("NFC is not enabled. current rfState:" + this.rfState);
this.sendNfcErrorResponse(message, NFC.NFC_GECKO_ERROR_NOT_ENABLED);
return null;
}
let isSendFile = message.name == "NFC:SendFile";
if (!isRFAPI && (this.rfState != NFC.NFC_RF_STATE_DISCOVERY)) {
debug("NFC is not enabled. current rfState:" + this.rfState);
this.sendNfcErrorResponse(message, NFC.NFC_GECKO_ERROR_NOT_ENABLED);
return null;
}
if (!isRFAPI && !isSendFile) {
// Update the current sessionId before sending to the NFC service.
message.data.sessionId = SessionHelper.getId(message.data.sessionToken);
}