Closed Bug 1072811 Opened 10 years ago Closed 10 years ago

[Bluetooth] BluetoothHelper APIv2 support

Categories

(Firefox OS Graveyard :: Gaia::Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S7 (24Oct)

People

(Reporter: gasolin, Assigned: gasolin)

References

Details

(Whiteboard: [p=3])

Attachments

(1 file)

add APIv2 support for BluetoothHelper so other apps could reuse it
Assignee: nobody → gasolin
The mock_navigator_moz_bluetooth.js should be updated as well.
Attached file pull request redirect to github (deleted) —
* 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] 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] 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+
Comment on attachment 8498724 [details] 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] 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)
Comment on attachment 8498724 [details] 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] 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)
Comment on attachment 8498724 [details] 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] 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)
Comment on attachment 8498724 [details] 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] pull request redirect to github Looks good for me. Thanks for Fred's help. r=me
Attachment #8498724 - Flags: review?(iliu) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [p=3]
Target Milestone: --- → 2.1 S7 (24Oct)
Blocks: 1088591
Blocks: 1088593
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: