Closed Bug 964672 Opened 10 years ago Closed 10 years ago

Don't call Pair() before sendFile() otherwise pairing dialog will be shown

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: echou, Assigned: arno)

References

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
jj.evelyn
: review+
Details | Review
I was told that the pairing dialog would still be shown when using NFC to transfer videos. Just checked and realized it's because pair() is called in function doPairing() in nfc_handover_manager.js. For Gaia apps which want to send file via Bluetooth, sendFile() is the only method has to be called.
Assignee: nobody → arno
Attachment #8369707 - Flags: review?(ehung)
(In reply to Eric Chou [:ericchou] [:echou] from comment #0)
> I was told that the pairing dialog would still be shown when using NFC to
> transfer videos. Just checked and realized it's because pair() is called in
> function doPairing() in nfc_handover_manager.js. For Gaia apps which want to
> send file via Bluetooth, sendFile() is the only method has to be called.

Does it mean in this stage, two devices have already paired?
Flags: needinfo?(arno)
(In reply to Evelyn Hung [:evelyn][:喵] from comment #2)
> (In reply to Eric Chou [:ericchou] [:echou] from comment #0)
> > I was told that the pairing dialog would still be shown when using NFC to
> > transfer videos. Just checked and realized it's because pair() is called in
> > function doPairing() in nfc_handover_manager.js. For Gaia apps which want to
> > send file via Bluetooth, sendFile() is the only method has to be called.
> 
> Does it mean in this stage, two devices have already paired?

The way I understood Eric is that BluetoothTransfer.sendFile() does an implicit pairing so I should not pair for outgoing file transfers. Just to clarify: before calling BT.sendFile() the two devices are *not* paired. Eric: can you please say if my interpretation is correct?
Flags: needinfo?(arno) → needinfo?(echou)
(In reply to arno from comment #3)
> (In reply to Evelyn Hung [:evelyn][:喵] from comment #2)
> > (In reply to Eric Chou [:ericchou] [:echou] from comment #0)
> > > I was told that the pairing dialog would still be shown when using NFC to
> > > transfer videos. Just checked and realized it's because pair() is called in
> > > function doPairing() in nfc_handover_manager.js. For Gaia apps which want to
> > > send file via Bluetooth, sendFile() is the only method has to be called.
> > 
> > Does it mean in this stage, two devices have already paired?
> 
> The way I understood Eric is that BluetoothTransfer.sendFile() does an
> implicit pairing so I should not pair for outgoing file transfers. Just to
> clarify: before calling BT.sendFile() the two devices are *not* paired.
> Eric: can you please say if my interpretation is correct?

Correct. Calling Pair() only if you want to explicitly create a strong bond between two Bluetooth devices. In this case, an 'unauthenticated link key' would be created between two devices after SendFile() is called, even there's no PIN code request or user confirmation request sent to Gaia. However, the link key just created may be removed automatically once the whole file-sharing process completes.
Flags: needinfo?(echou)
Comment on attachment 8369707 [details] [review]
Don't call Pair() before sendFile()

looks good to me. Thanks!

also thank Eric's explanation.
Attachment #8369707 - Flags: review?(ehung) → review+
re-run CI, will merge it if travis green:
https://travis-ci.org/mozilla-b2g/gaia/builds/18164182
(In reply to Evelyn Hung [:evelyn][:喵] from comment #6)
> re-run CI, will merge it if travis green:
> https://travis-ci.org/mozilla-b2g/gaia/builds/18164182

tried several times but still failed, but I guess it's not your fault... Can you rebase to latest master build to trigger another CI round? Thanks.
Flags: needinfo?(arno)
Flags: needinfo?(arno)
merged into gaia master: https://github.com/mozilla-b2g/gaia/commit/66e0ddf60c3711432bba01875c60540cab3c0d93
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: