If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[Bluetooth] BluetoothHelper APIv2 support

RESOLVED FIXED in 2.1 S7 (24Oct)

Status

Firefox OS
Gaia::Bluetooth
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gasolin, Assigned: gasolin)

Tracking

unspecified
2.1 S7 (24Oct)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [p=3])

Attachments

(1 attachment)

46 bytes, text/x-github-pull-request
iliu@mozilla.com, ianliu.moz@gmail.com
: review+
Details | Review | Splinter Review
(Assignee)

Description

3 years ago
add APIv2 support for BluetoothHelper so other apps could reuse it
(Assignee)

Updated

3 years ago
Assignee: nobody → gasolin
(Assignee)

Comment 1

3 years ago
The mock_navigator_moz_bluetooth.js should be updated as well.
(Assignee)

Comment 2

3 years ago
Created attachment 8498724 [details] [review]
pull request redirect to github

* Add v2 API detection and _adaptorV2 for BluetoothHelper
* update mock_navigator_moz_bluetooth.js to support v1/v2 API

@Ian like to hear your feedback
Attachment #8498724 - Flags: feedback?(iliu)
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Fred,

Feedback+ for v2 API detection and test supported v1/v2. And I leave some comment on Github. I think we can remove tests of pairing API in part of v2. These will be useless in the future. Thanks for your effort here.
Attachment #8498724 - Flags: feedback?(iliu) → feedback+
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Hi Fred,

Since we have discussion with Ben, `navigator.mozBluetooth.defaultAdapter` might be null while the device launching or no one get adapter from Bluetooth module. We have to use `onattributechanged` interface to identify the API version.
Attachment #8498724 - Flags: feedback+
(Assignee)

Comment 5

3 years ago
Comment on attachment 8498724 [details] [review]
pull request redirect to github

* patch bluetooth_helper for v2 support
* clean up the _callback queue
* revice bluetooth mockup to switch between v1/v2
* patch uitest/HW/bluetooth to validate the bluetooth_helper
Attachment #8498724 - Flags: review?(iliu)
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Fred, I leave some suggestion on GitHub. Some of the code base is not useful in API v2. We have to do some change. And if the mock_navigator_moz_bluetooth.js is hard to maintain to version, I would like to create a new mock. Once Gecko::Bluetooth is no longer to use API v1, we can remove v1 code base and revise file name easily.
Attachment #8498724 - Flags: review?(iliu)
(Assignee)

Comment 7

3 years ago
Comment on attachment 8498724 [details] [review]
pull request redirect to github

separate mock_navigator_moz_bluetooth.js/mock_navigator_moz_bluetooth_v2.js and make v2 as default API in bluetooth helper
Attachment #8498724 - Flags: review?(iliu)
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Fred, thanks for your understand. And I leave some comment for the updated patch on GitHub.

* some useless mock in mock_navigator_moz_bluetooth_v2.js
* have to provide unit test for enable, disable methods for the helper
* some of the API are not working in version 2(have to do some version check too)
Attachment #8498724 - Flags: review?(iliu)
(Assignee)

Comment 9

3 years ago
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Follow http://dxr.mozilla.org/mozilla-central/source/dom/webidl/BluetoothAdapter2.webidl and made `deprecated API message` in BT helper.

Would found and add the alternative API in followup system patch.
Attachment #8498724 - Flags: review?(iliu)
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Fred, the patch is almost there. But you remove some using methods in shared/test/unit/mocks/mock_navigator_moz_bluetooth.js. Please check my comment on GitHub. Thanks.
Attachment #8498724 - Flags: review?(iliu)
(Assignee)

Comment 11

3 years ago
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Thanks for pointing out, add back missing methods. Please kindly review it again
Attachment #8498724 - Flags: review?(iliu)
Comment on attachment 8498724 [details] [review]
pull request redirect to github

Looks good for me. Thanks for Fred's help. r=me
Attachment #8498724 - Flags: review?(iliu) → review+
(Assignee)

Comment 13

3 years ago
merged https://github.com/mozilla-b2g/gaia/commit/29ed78a26d62b58f663437a45f273d57b9781d79

thanks!
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Whiteboard: [p=3]
Target Milestone: --- → 2.1 S7 (24Oct)
(Assignee)

Updated

3 years ago
Blocks: 1088591
(Assignee)

Updated

3 years ago
Blocks: 1088593
You need to log in before you can comment on or make changes to this bug.