Closed
Bug 978707
Opened 11 years ago
Closed 10 years ago
B2G NFC: sessionToken can be used to get NFCPeer and NFCTag object
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(tracking-b2g:backlog)
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
(Whiteboard: [p=1])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
dimi
:
review+
|
Details | Diff | Splinter Review |
This bug is related to Bug 963533, maybe we could duplicate this bug to Bug 963533 in the future, right now I just filed it as a seperate bug. Currently we can get sessionToken from nfc-manager-tech-discovered system message, inside this message has a property called 'sessionToken', and we could use this sessionToken to get NFCTag or NFCPeer object. (This also prevents the Structured Clone problem). And Gaia app will check if 'P2P' is contained in the techList property, if it is, the Gaia app should use mozNfc.getPeer(sessionToken), otherwise it should use mozNfc.getTag(sessionToken). However if the app doesn't do this correctly, // Supposed the sessionToken is from a NFC Tag. var nfcTag = mozNfc.getTag(sessionToken); // doing tag functionalities. var nfcTag = mozNfc.getPeer(sessionToken); // Should we allow app the get a NFCPeer here, ever the session is actually referring to a NFC Tag. Or should we let app could do this freely?
Comment 1•11 years ago
|
||
Also related to Bug 963541. I believe we should enforce a close session before allowing switching with get{Technology}, or automatically close it. I prefer a throw just to make it clear to the programmer. Question then becomes, enforce this at external/nfcd, or in system/gonk?
Depends on: 963541
Updated•11 years ago
|
Blocks: b2g-NFC-2.0
Updated•11 years ago
|
No longer blocks: b2g-NFC-2.0
Updated•11 years ago
|
Assignee: nobody → psiddh
Comment 2•11 years ago
|
||
As referenced above, see also https://bugzilla.mozilla.org/show_bug.cgi?id=963533#c5
Updated•11 years ago
|
blocking-b2g: --- → backlog
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 4•10 years ago
|
||
Reopen for this should have some fix in Gecko Chrome process, Bug 963533 should focus on WebAPI level.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Updated•10 years ago
|
Assignee: psiddh → allstars.chh
Comment 6•10 years ago
|
||
Comment on attachment 8516568 [details] [diff] [review] Patch Review of attachment 8516568 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/nfc/gonk/Nfc.js @@ +315,5 @@ > + let sessionToken = message.data.sessionToken; > + let sessionId = SessionHelper.getId(sessionToken); > + if (!SessionHelper.isValidToken(sessionToken) || > + message.data.isP2P !== SessionHelper.isP2PSession(sessionId)) { > + debug("Received invalid Session Token: " + sessionToken); From the idea here it looks like a "valid" session token stands for session token exists, and its type(isP2P) should be also correct. If this is the case, maybe we could just use: SessionHelper.isValidToken(sessionToken, type) to do the check. But make the API simple is also ok for me, just propose another idea.
Attachment #8516568 -
Flags: review?(dlee) → review+
Assignee | ||
Comment 7•10 years ago
|
||
merged into one function, r? to Dimi again.
Attachment #8516568 -
Attachment is obsolete: true
Attachment #8517259 -
Flags: review?(dlee)
Updated•10 years ago
|
Attachment #8517259 -
Flags: review?(dlee) → review+
Assignee | ||
Comment 8•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/798710d73edc
Whiteboard: [p=1]
Target Milestone: --- → 2.1 S8 (7Nov)
Comment 9•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/798710d73edc
Status: REOPENED → RESOLVED
Closed: 11 years ago → 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
blocking-b2g: backlog → ---
tracking-b2g:
--- → backlog
You need to log in
before you can comment on or make changes to this bug.
Description
•