Closed Bug 1070823 Opened 10 years ago Closed 10 years ago

[Bluetooth][Settings] bluetooth panel support BT v2 API

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:+, b2g-master fixed)

RESOLVED FIXED
2.1 S9 (21Nov)
tracking-b2g +
Tracking Status
b2g-master --- fixed

People

(Reporter: gasolin, Assigned: iliu)

References

Details

Attachments

(1 file, 1 obsolete file)

We need a new settings panel in gaia to support Bluetooth v2 API. With new API detection, we can decouple the work of Gaia and Gecko. Once we land this issue, gecko could switch to BTv2 API anytime. Once gecko is fully switched, we could remove the old panel. Bluetooth API v1 https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API v2 https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2
Blocks: 892172
No longer blocks: 892172
Blocks: 1066010
No longer blocks: 1066010
Bug 1074075 is ready to land. I can start to work on the new code base.
Assignee: nobody → iliu
Depends on: 1074075
Status: NEW → ASSIGNED
Target Milestone: --- → 2.1 S7 (Oct24)
Depends on: 1085290
Target Milestone: 2.1 S7 (24Oct) → 2.1 S8 (7Nov)
Attached file WIP 26139 (obsolete) —
Arthur, I would need your feedback for the architecture of Bluetooth panel/module in v2.0 API. The major modification is as following. Thanks. * Functionality ready item: - Enable/Disable - Visible - Device List (Remote/Paired) - Search (startDiscovery) * Functionality not ready item: - Pair - Connection of paired device - Timeout visible, Rename with new layout - Icon type of device item
Attachment #8522859 - Flags: feedback?(arthur.chen)
Target Milestone: 2.1 S8 (7Nov) → 2.1 S9 (21Nov)
Comment on attachment 8522859 [details] WIP 26139 Looks good! There are two major comments: - We should consider the cases of adding/removing the default adapter and the states of with/without the default adapter. - Suggest to wrap the found bluetooth devices with an Observable (we could create a separate module for that) because there should be many modules interested the attribute changes from them.
Attachment #8522859 - Flags: feedback?(arthur.chen) → feedback+
Attached file pull request 26139
Thanks for Arthur's feedback in side of architecture. I have updated the WIP per comment 6. Since the part of architecture is revised, I would need the second feedback here.:)
Attachment #8525188 - Flags: feedback?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 The part of wrapping a bluetooth device with an Observable is good. However, there seems no much difference for the parts regarding the default adapter. Note that we should do: - make AdapterManager reflects the change of the default adapter - make BtContext have two modes for with/without the default adapter
Attachment #8525188 - Flags: feedback?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 I forget to make an observable property 'defaultAdapter' for AdapterManager. I have updated the patch with your comment on GitHub/comment 9. Thanks for your reminder.
Attachment #8525188 - Flags: feedback?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 Awesome! f=me.
Attachment #8525188 - Flags: feedback?(arthur.chen) → feedback+
Arthur, thanks for your feedback first. I will keep to implement unfinished functionality in comment 3. While these major functionality are ready, I will set the patch in reviewing process. Before implement v2 API in Bluetooth app, we should make Bluetooth app to support AMD for module reuse.
Depends on: 1102796
Depends on: 1102798
No longer depends on: 1102796
Blocks: 1121904
Blocks: 1121912
Blocks: 1121913
Blocks: 1122365
Comment on attachment 8525188 [details] [review] pull request 26139 Arthur, I have added unit test for the main module 'bluetooth_context'. I think we can start to go into reviewing process. To compare with feedback patch before, the modification is as following. * '_refreshPairedDevicesInfo' function. * '_getBluetoothDevice' module with promise call. * Add debug log for all modules. We can toggle on/off debugging log if we need. I will keep to add unit test for other modules. Thanks.
Attachment #8525188 - Flags: review?(arthur.chen)
(In reply to Ian Liu [:ianliu] from comment #13) > Comment on attachment 8525188 [details] [review] > pull request 26139 > > To compare with feedback > patch before, the modification is as following. > > * '_refreshPairedDevicesInfo' function. > * '_getBluetoothDevice' module with promise call. > * Add debug log for all modules. We can toggle on/off debugging log if we > need. * Set device name with dialog service. * Add unit test for 'bluetooth_adapter_manager'.
* Add unit tests for all new modules compeletly.
Comment on attachment 8525188 [details] [review] pull request 26139 Good job! One general comment would be returning a promise for async functions. This enables more flexibility for UI operations and makes testing easier as we can simply do the assertion in the 'then' function.
Attachment #8525188 - Flags: review?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 Revised the patch with reviewer's suggestion. The major change is as following: * Revise asynchronies functions to return promise. ** Resolve in API's resolve case only. ** Reject with reason.(same state, state transition, Bluetooth is disabled, no default adapter). * Move `Debug` function to local. * Revise unit test for covering these change. Arthur, it will need your review in second round. Thanks.
Attachment #8525188 - Flags: review?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 One last comment to be addressed, please check github, thanks!
Attachment #8525188 - Flags: review?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 I have updated the patch with some comment on GitHub. And thanks for Arthur's help on Gij, Gip test failed. Looks like there is no non-intermittent test failed now. And the patch is working fine on Jamin's local build with Bluetooth API v2. Request review again.
Attachment #8525188 - Flags: review?(arthur.chen)
Comment on attachment 8525188 [details] [review] pull request 26139 r=me, thank you!
Attachment #8525188 - Flags: review?(arthur.chen) → review+
Thanks for Arthur's review with such patient. And very clear to guide how these useful component we already have in settings app. It makes the new code base lightly and reuse-full. Let's wait all test case pass on try-server. Then we can land the patch later.
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list. Note: Until bug 1095028 lands, the patch *must* have a review by a suggested reviewer. If you are the patch author, you can leave an additional R+ on the attachment for autolander to process it.
Keywords: checkin-needed
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list. Note: Until bug 1095028 lands, the patch *must* have a review by a suggested reviewer. If you are the patch author, you can leave an additional R+ on the attachment for autolander to process it.
Component: Bluetooth → Gaia::Settings
Keywords: checkin-needed
Keywords: checkin-needed
There was an error creating the taskgraph, please try again. If the issue persists please contact someone in #taskcluster.
Keywords: checkin-needed
Since the pull request are landed, we can close the issue now. Gaia/master: b76329ca62b20a795d7af2d50a502bd19178973d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Depends on: 1129801
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: