Bug 1111528 - onpeerfound shouldn't be called when receiving NDEF from another peer. r=dimi
authorYoshi Huang <allstars.chh@mozilla.com>
Mon, 15 Dec 2014 18:19:25 +0800
changeset 220134 7d696e87efb126d03e92ad5b84371b2773a345b9
parent 220111 80a4dc7438a54e0440037f80726c28fc2e90792a
child 220135 bd138738b7f8763b8385d8a73492a7d8578a5c3a
push id10457
push userryanvm@gmail.com
push dateThu, 18 Dec 2014 01:54:25 +0000
treeherderfx-team@0e441ff66c5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdimi
bugs1111528
milestone37.0a1
Bug 1111528 - onpeerfound shouldn't be called when receiving NDEF from another peer. r=dimi
dom/nfc/gonk/Nfc.js
--- a/dom/nfc/gonk/Nfc.js
+++ b/dom/nfc/gonk/Nfc.js
@@ -466,17 +466,21 @@ Nfc.prototype = {
         // Update the upper layers with a session token (alias)
         message.sessionToken =
           SessionHelper.registerSession(message.sessionId, message.isP2P);
         // Do not expose the actual session to the content
         let sessionId = message.sessionId;
         delete message.sessionId;
 
         if (SessionHelper.isP2PSession(sessionId)) {
-          gMessageManager.onPeerEvent(NFC.PEER_EVENT_FOUND, message.sessionToken);
+          if (message.records) {
+            // TODO: Bug 1082493.
+          } else {
+            gMessageManager.onPeerEvent(NFC.PEER_EVENT_FOUND, message.sessionToken);
+          }
         } else {
           gMessageManager.onTagFound(message);
         }
 
         let sysMsg = new NfcTechDiscoveredSysMsg(message.sessionToken,
                                                  message.isP2P,
                                                  message.records);
         gSystemMessenger.broadcastMessage("nfc-manager-tech-discovered", sysMsg);