Closed
Bug 1128383
Opened 10 years ago
Closed 10 years ago
[Bluetooth] There is no way to cancel incoming pairing request since the API v2 no 'bluetooth-cancel' system message.
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
2.2 S8 (20mar)
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: iliu, Assigned: ben.tian)
References
Details
(Whiteboard: [webbt-api])
Attachments
(1 file, 2 obsolete files)
Since I'm working on implementation of pairing flow, I find out problem to cancel incoming pairing request.
STD:
1. Turn Bluetooth on.
2. Set visible on.
3. Use a remote device to pair with FFOS phone.
4. The pairing dialog shows to wait a user confirmation.
5. Cancel the pairing request from remote device.
Expected:
The pairing dialog should be close.
Actual:
The pairing dialog still waits a user confirmation.
Reporter | ||
Comment 1•10 years ago
|
||
Since we cannot receive 'bluetooth-cancel' system message, we have to find out a way(Gaia/Gecko) to handle this use case here. I file the bug for a note.
Reporter | ||
Comment 2•10 years ago
|
||
For reference in Gaia code base currently.
https://github.com/mozilla-b2g/gaia/blob/master/apps/bluetooth/js/modules/pair_manager.js#L53-L56
Reporter | ||
Comment 3•10 years ago
|
||
Hi Jamin,
Per offline discussion for this use case before, is Gaia able to reach the cancel message in API version 2? Thanks.
Flags: needinfo?(jaliu)
Comment 4•10 years ago
|
||
Hi Ian,
Bluetooth team will provide a new event handler called "BluetoothAdapter.onaborted" to let Gaia layer knows the connected was cancelled. (or aborted)
Thank you.
Assignee: nobody → jaliu
Flags: needinfo?(jaliu)
Reporter | ||
Comment 5•10 years ago
|
||
Good idea with the new event. I file another bug 1128399 for tracking Gaia task.
Updated•10 years ago
|
Whiteboard: [webbt-api]
Assignee | ||
Comment 6•10 years ago
|
||
Assignee: jaliu → btian
Assignee | ||
Updated•10 years ago
|
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8569722 -
Attachment is obsolete: true
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8570343 [details] [diff] [review]
Patch 1 (v2): Add adapter.onpairingaborted event handler
Request for review and feedback first. I'll rebase on bug 1127665 once it's landed.
Attachment #8570343 -
Flags: review?(shuang)
Attachment #8570343 -
Flags: feedback?(jaliu)
Comment on attachment 8570343 [details] [diff] [review]
Patch 1 (v2): Add adapter.onpairingaborted event handler
Review of attachment 8570343 [details] [diff] [review]:
-----------------------------------------------------------------
For dom/base/nsGkAtomList.h, you need to ask dom peers to review.
Comment on attachment 8570343 [details] [diff] [review]
Patch 1 (v2): Add adapter.onpairingaborted event handler
Review of attachment 8570343 [details] [diff] [review]:
-----------------------------------------------------------------
Overall, it looks good to me, one comment for error handling. What do you think?
::: dom/base/nsGkAtomList.h
@@ +825,5 @@
> GK_ATOM(onpagehide, "onpagehide")
> GK_ATOM(onpageshow, "onpageshow")
> GK_ATOM(onpaint, "onpaint")
> GK_ATOM(onpairedstatuschanged, "onpairedstatuschanged")
> +GK_ATOM(onpairingaborted, "onpairingaborted")
Leave this to Dom peer to review.
::: dom/bluetooth2/BluetoothAdapter.cpp
@@ +365,5 @@
> BluetoothStatusChangedEvent::Constructor(this, aData.name(), init);
> DispatchTrustedEvent(event);
> + } else if (aData.name().EqualsLiteral(PAIRING_ABORTED_ID) ||
> + aData.name().EqualsLiteral(REQUEST_MEDIA_PLAYSTATUS_ID)) {
> + DispatchEmptyEvent(aData.name());
This seems to me not necessary to extract 6 lines of code to an another new function (and it has only been used here). But if you think the original code is not clear enough, I'm fine with this change.
::: dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.cpp
@@ +1634,4 @@
> }
> + case STATUS_BUSY:
> + case STATUS_AUTH_FAILURE:
> + case STATUS_RMT_DEV_DOWN:
Followed bug 1128386 (though the case is not the same), can we add case STATUS_FAIL to indicate authentication failure? Although default condition could capture it. stack can send this if there is an internal error.
::: dom/webidl/BluetoothAdapter2.webidl
@@ +80,5 @@
> [NewObject, AvailableIn=CertifiedApps]
> Promise<void> disable();
>
> [NewObject, AvailableIn=CertifiedApps]
> + Promise<void> setName(DOMString name);
Good catch!
Attachment #8570343 -
Flags: review?(shuang)
Assignee | ||
Comment 11•10 years ago
|
||
(In reply to Shawn Huang [:shawnjohnjr] from comment #10)
> ::: dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.cpp
> @@ +1634,4 @@
> > }
> > + case STATUS_BUSY:
> > + case STATUS_AUTH_FAILURE:
> > + case STATUS_RMT_DEV_DOWN:
>
> Followed bug 1128386 (though the case is not the same), can we add case
> STATUS_FAIL to indicate authentication failure? Although default condition
> could capture it. stack can send this if there is an internal error.
I follow API1 that sends 'cancel' for these cases. Might STATUS_FAIL be authentication error?
https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp#1577
Flags: needinfo?(shuang)
(In reply to Ben Tian [:btian] from comment #11)
> (In reply to Shawn Huang [:shawnjohnjr] from comment #10)
> > ::: dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.cpp
> > @@ +1634,4 @@
> > > }
> > > + case STATUS_BUSY:
> > > + case STATUS_AUTH_FAILURE:
> > > + case STATUS_RMT_DEV_DOWN:
> >
> > Followed bug 1128386 (though the case is not the same), can we add case
> > STATUS_FAIL to indicate authentication failure? Although default condition
> > could capture it. stack can send this if there is an internal error.
>
> I follow API1 that sends 'cancel' for these cases. Might STATUS_FAIL be
> authentication error?
> https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluedroid/
> BluetoothServiceBluedroid.cpp#1577
This is something we discussed in Bug 1120889 Comment 7 (caused by cgroup change).
During the pairing procedure, we got STATUS_FAIL from stack. It seems to me that anything causes pairing failure and it does not involve actual authentication procedure, the stack returned STATUS_FAIL.
Flags: needinfo?(shuang)
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8570343 -
Attachment is obsolete: true
Attachment #8570343 -
Flags: feedback?(jaliu)
Attachment #8573744 -
Flags: review?(shuang)
Attachment #8573744 -
Flags: feedback?(joliu)
Attachment #8573744 -
Flags: feedback?(jaliu)
Comment 14•10 years ago
|
||
Comment on attachment 8573744 [details] [diff] [review]
Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
Review of attachment 8573744 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM.
Attachment #8573744 -
Flags: feedback?(joliu) → feedback+
Comment 15•10 years ago
|
||
Comment on attachment 8573744 [details] [diff] [review]
Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
Review of attachment 8573744 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8573744 -
Flags: feedback?(jaliu) → feedback+
Comment on attachment 8573744 [details] [diff] [review]
Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
Review of attachment 8573744 [details] [diff] [review]:
-----------------------------------------------------------------
Except for nsGkAtomList.h, BluetoothAdapter2.webidl, r=me. Please find DOM peer to check.
Attachment #8573744 -
Flags: review?(shuang) → review+
Assignee | ||
Comment 17•10 years ago
|
||
Comment on attachment 8573744 [details] [diff] [review]
Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
Hi Boris,
Can you help review BluetoothAdapter2.webidl and nsGkAtomList.h change of the patch? This patch adds an event handler to notify application of bluetooth pairing error/cancellation.
Attachment #8573744 -
Attachment description: Patch 1 (v3): Add adapter.onpairingaborted event handler → Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
Attachment #8573744 -
Flags: review?(bzbarsky)
Comment 18•10 years ago
|
||
Comment on attachment 8573744 [details] [diff] [review]
Patch 1 (v3): Add adapter.onpairingaborted event handler, f=jocelyn, f=jaliu, r=shuang
r=me on the webidl/gkatomlist changes.
Attachment #8573744 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 19•10 years ago
|
||
No try since the folder isn't built by default.
https://hg.mozilla.org/integration/b2g-inbound/rev/96351c40afc8
Comment 20•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S8 (20mar)
You need to log in
before you can comment on or make changes to this bug.
Description
•