Closed Bug 958423 Opened 6 years ago Closed 6 years ago

B2G NFC: ndef in 'nfc-manager-tech-discovered' is two levels of array.

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
1.3 C2/1.4 S2(17jan)

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

Attachments

(2 files, 1 obsolete file)

In the system message, nfc-manager-tech-discovered, it contains a ndef property,however it's in two levels of array:

[[{...}, {...}]

The outter one is the array of NdefMessages, the inner one is the array of NdefRecords.
Given that only one NdefMessage is needed, for simplicity we could use only 1 level of array here.

Also Gaia won't have to always pick the first NdefMessage in https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/nfc_manager.js#L375
Also the NdefMessage in nfc-manager-tech-discovered system message is called 'ndef', however in the ReadNdefResponse it's caleld 'records'.

The naming should be consistent here.
Attached patch Bug958423.patch (obsolete) — Splinter Review
Assignee: nobody → allstars.chh
Attached file Gaia PullRequest
Attachment #8359094 - Flags: review?(alive)
Attachment #8359094 - Flags: review?(alive) → review+
Attached patch Patch v2.Splinter Review
rebase for Bug 950269 is landed.
Attachment #8359091 - Attachment is obsolete: true
Attachment #8360163 - Flags: review+
Looks like the Pull Request has conflicts. Please rebase and re-request checkin :)
Keywords: checkin-needed
Whiteboard: [leave open for Gaia patch]
Blocks: 960222
Thanks, I have re-pushed again to fix the conflict.
Adding checkin-needed back to the Gaia patch.
Keywords: checkin-needed
Whiteboard: [leave open for Gaia patch]
Master: https://github.com/mozilla-b2g/gaia/commit/1472c1bfa410cc757d5c29757f267dfcc1af7c8e
Status: NEW → RESOLVED
Closed: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C2/1.4 S2(17jan)
Patch 2 seems to P2P break presence detect, which has no ndefMessage to unmarshall:

I/Gecko   (  179): Nfc Worker: Handling parcel as NFC_NOTIFICATION_TECH_DISCOVERED
I/Gecko   (  179): Nfc Worker: NFC_NOTIFICATION_TECH_DISCOVERED
I/Gecko   (  179): Nfc Worker: Parcel handling threw Error: Trying to read data beyond the parcel end!
Garner filed Bug 960790 for this.
You need to log in before you can comment on or make changes to this bug.