Closed Bug 1132345 Opened 9 years ago Closed 9 years ago

[BT API v2] Handle ondisplaypasskeyreq and onpairingconsentreq from Bluetooth App

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yrliou, Assigned: iliu)

References

Details

(Whiteboard: [webbt-api])

Attachments

(1 file)

In these two pairing types, Bluetooth app needs to

ondisplaypasskeyreq: Display the passkey to user and listen to pairing status update for the pairing result. And user should be able to reject the request from the pairing dialog.

onpairingconsentreq: Ask user to accept or reject the incoming consent pairing request.
Assignee: nobody → iliu
Status: NEW → ASSIGNED
Since Bug 132343 is going to support the other pairing methods(ondisplaypasskeyreq/onpairingconsentreq) with new interface accept()/reject(), some of the Gaia works are needed to do regarding to API changed. I summarize these works that Gaia::Bluetooth have to do in this bug.

Ref: https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#handle
The new definition of BluetoothPairingEvent method handle() is changed as following.

* Interface New exposed:
ondisplaypasskeyreq: Have to show passkey(not ready), with reject().
onpairingconsentreq: With accept()/reject().(will need to reduce description for pairing dialog, have to confirm with UX)

* Interface changed:
onenterpincodereq: With reject().(instead of setPinCode('EMPTY_STRING'))
onpairingconfirmationreq: Have to show passkey(done), with accept()/reject().(instead of setPairingConfirmation(Boolean))
(In reply to Ian Liu [:ianliu] from comment #1)
> Since Bug 132343 is going to support the other pairing
Wording.. Bug 1132343
Per offline discussion with Jocelyn and Jamin before, I explain the user story for the two events. If my description is wrong, please feel free to correct me.

* 'ondisplaypasskeyreq' event
This event is coming while we want to pair with a Bluetooth keyboard. And there is no screen on the keyboard device. In this case, FFOS phone have to display a passkey for the device input and pair. In the other words, the remote devices have input I/O without display screen. The pairing process will be triggered via this event.

UI proposal:
Since we have description for 'passkey' method in Bluetooth API v1, we have strings as following already. I think we can reuse the description as before.

{{device}} would like to pair with this phone. To accept, enter the passkey on the device.[1]


* 'onpairingconsentreq' event
This event is coming while pairing with a remote device. And the pairing process is very simply without passkey. We just to accept or reject the pairing request only.

UI proposal:
Since we have description for 'onpairingconfirmationreq' event in Bluetooth API v2, we already have strings as following. I think we can reduce the description without any 'PIN' info.

{{device}} would like to pair with this phone. To accept, make sure that both devices currently have the following PIN displayed:
==>
{{device}} would like to pair with this phone. "Might to do more description here.."[2]



Omega,

Since Jenny is on PTO, could you please help to make give some suggestion for the two description[1][2]? And we need the spec. for the user story. Thanks.
Flags: needinfo?(ofeng)
Hi Ian, my suggestions are:

[1]
{{device}} would like to pair with this phone. To accept, input the passkey and then press Return or Enter on the device.

[2]
{{device}} would like to pair with this phone.
Flags: needinfo?(ofeng)
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

Hi Jocelyn, 

This is a work in process patch without UX input. But it should be working for Bug 1132343. Could you please feedback for the patch with API changed? Thanks.
Attachment #8586669 - Flags: feedback?(joliu)
(In reply to Omega Feng [:Omega] [:馮於懋] (please ni?) from comment #4)
> Hi Ian, my suggestions are:
> 
> [1]
> {{device}} would like to pair with this phone. To accept, input the passkey
> and then press Return or Enter on the device.
> 
> [2]
> {{device}} would like to pair with this phone.
Thanks for Omega's support here immediately. I have updated the patch with new string definition[1][2].
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

I have tried with gecko patch.
Both requests work from my end.
Attachment #8586669 - Flags: feedback?(joliu) → feedback+
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

Thanks for Jocelyn feedback here! 

Arthur, I think we can start to go into reviewing process. I have updated the patch with unit test. It covers all of the change in this patch.
Attachment #8586669 - Flags: review?(arthur.chen)
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

The suggestions are mainly focus on the naming of the functions given the usage of the existing functions are slightly changed. The other parts are looking good to me. Details please refer to github, thanks.
Attachment #8586669 - Flags: review?(arthur.chen)
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

Arthur, I have updated the patch with your suggestion. And I leave comment on GitHub for some non-essentail reason. Will need your review again. Thanks.
Attachment #8586669 - Flags: review?(arthur.chen)
Comment on attachment 8586669 [details] [review]
[gaia] ian-liu:bluetooth/bug1132345_handle_BluetoothPairingEvent_interface_changed > mozilla-b2g:master

r=me, thank you for the effort!
Attachment #8586669 - Flags: review?(arthur.chen) → review+
Thanks for Arthur's reviewing effort. Since the patch is landed, we can close the issue now.

Gaia/master: https://github.com/mozilla-b2g/gaia/commit/baaf1020a5af69855a41e4755035f131c9b444e2
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: