Closed
Bug 1223806
Opened 9 years ago
Closed 9 years ago
Move Bluetooth Core interface into separate class
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(firefox45 fixed)
RESOLVED
FIXED
2.6 S1 - 11/20
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: tzimmermann, Assigned: tzimmermann)
References
Details
Attachments
(5 files, 3 obsolete files)
10.76 KB,
patch
|
ben.tian
:
review+
brsun
:
feedback+
|
Details | Diff | Splinter Review |
15.35 KB,
patch
|
ben.tian
:
review+
brsun
:
feedback+
|
Details | Diff | Splinter Review |
11.99 KB,
patch
|
ben.tian
:
review+
brsun
:
feedback+
|
Details | Diff | Splinter Review |
48.53 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
24.57 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
The core Bluetooth backend interfaces are currently provided by |BluetoothInterface| and implemented by |BluetoothDaemonInterface|. There shoudl be a separate interface |BluetoothCoreInterface| with implementation. |BluetoothInterface| will only be responsible for the connection to the Bluetooth daemon.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → tzimmermann
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8686066 -
Flags: review?(brsun)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8686067 -
Flags: review?(brsun)
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8686068 -
Flags: review?(brsun)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8686069 -
Flags: review?(brsun)
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8686070 -
Flags: review?(brsun)
Comment 6•9 years ago
|
||
Hi Thomas, Sorry for the late reply. Basically these patches look good to me. But since Ben has some concrete ideas on refining interfaces (see bug 1221477), I would suggest to let him discuss more on these changes with you. I am more than happy to input my comments if debate occurs.
Updated•9 years ago
|
Attachment #8686066 -
Flags: review?(btian)
Attachment #8686066 -
Flags: review?(brsun)
Attachment #8686066 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8686067 -
Flags: review?(btian)
Attachment #8686067 -
Flags: review?(brsun)
Attachment #8686067 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8686068 -
Flags: review?(btian)
Attachment #8686068 -
Flags: review?(brsun)
Attachment #8686068 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8686069 -
Flags: review?(btian)
Attachment #8686069 -
Flags: review?(brsun)
Attachment #8686069 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8686070 -
Flags: review?(btian)
Attachment #8686070 -
Flags: review?(brsun)
Attachment #8686070 -
Flags: feedback+
Comment 7•9 years ago
|
||
Comment on attachment 8686069 [details] [diff] [review] [04] Bug 1223806: Add |BluetoothDaemonCoreInterface| Review of attachment 8686069 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8686069 -
Flags: review?(btian) → review+
Comment 8•9 years ago
|
||
Comment on attachment 8686066 [details] [diff] [review] [01] Bug 1223806: Add Bluetooth Core interface, notification and result handler Review of attachment 8686066 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8686066 -
Flags: review?(btian) → review+
Comment 9•9 years ago
|
||
Comment on attachment 8686067 [details] [diff] [review] [02] Bug 1223806: Convert Bluetooth to |BluetoothCoreResultHandler| Review of attachment 8686067 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8686067 -
Flags: review?(btian) → review+
Comment 10•9 years ago
|
||
Comment on attachment 8686068 [details] [diff] [review] [03] Bug 1223806: Convert Bluetooth to |BluetoothCoreNotificationHandler| Review of attachment 8686068 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8686068 -
Flags: review?(btian) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8686070 [details] [diff] [review] [05] Bug 1223806: Convert Bluetooth to |BluetoothCoreInterface| Review of attachment 8686070 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ +144,4 @@ > BluetoothService* bs = BluetoothService::Get(); > NS_ENSURE_TRUE_VOID(bs); > > + auto coreInterface = sBtInterface->GetBluetoothCoreInterface(); How about remember |sBtCoreInterface| to save these additional checks? @@ +1152,5 @@ > > + auto coreInterface = sBtInterface->GetBluetoothCoreInterface(); > + if (!coreInterface) { > + DispatchReplyError(aRunnable, STATUS_FAIL); > + return NS_ERROR_FAILURE; Why do some methods return NS_OK but some returns NS_ERROR_FAILURE?
Attachment #8686070 -
Flags: review?(btian)
Assignee | ||
Comment 12•9 years ago
|
||
Changes since v1: - store core-interface pointer for service manager This change should also resolve the comment about the return values.
Attachment #8686070 -
Attachment is obsolete: true
Attachment #8687972 -
Flags: review?(btian)
Comment 13•9 years ago
|
||
Comment on attachment 8687972 [details] [diff] [review] [05] Bug 1223806: Convert Bluetooth to |BluetoothCoreInterface| (v2) Review of attachment 8687972 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. Note macros in [1] should be revised as well. I'll open a followup bug for it.
Attachment #8687972 -
Flags: review?(btian) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8687972 [details] [diff] [review] [05] Bug 1223806: Convert Bluetooth to |BluetoothCoreInterface| (v2) Review of attachment 8687972 [details] [diff] [review]: ----------------------------------------------------------------- One more place to revise. ::: dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ +2246,3 @@ > // Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., it should > // be connectable and non-discoverable. > NS_ENSURE_TRUE_VOID(sBtInterface); Replace with |sBtCoreInterface|.
Comment 15•9 years ago
|
||
Thomas, Two more questions after patch 5 is landed: 1) Does non-null |sBtCoreInterface| implies non-null |sBtInterface|? 2) Does "BluetoothService::IsEnabled() == true" implies non-null |sBtCoreInterface|? (In reply to Ben Tian [:btian] from comment #14) > Comment on attachment 8687972 [details] [diff] [review] > [05] Bug 1223806: Convert Bluetooth to |BluetoothCoreInterface| (v2) > > Review of attachment 8687972 [details] [diff] [review]: > ----------------------------------------------------------------- > > One more place to revise. > > ::: dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp > @@ +2246,3 @@ > > // Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., it should > > // be connectable and non-discoverable. > > NS_ENSURE_TRUE_VOID(sBtInterface); > > Replace with |sBtCoreInterface|.
Flags: needinfo?(tzimmermann)
Assignee | ||
Comment 16•9 years ago
|
||
Hi Yes, both should be true. (In reply to Ben Tian [:btian] from comment #15) > Thomas, > > Two more questions after patch 5 is landed: > 1) Does non-null |sBtCoreInterface| implies non-null |sBtInterface|? I don't think the current code is very strict about setting |sBtInterface| to nullptr, but the intend is that a valid address in |sBtCoreInterface| always implies a valid address in |sBtInterface|. The start and stop machinery in |BluetoothServiceBluedroid| should take care of this. > 2) Does "BluetoothService::IsEnabled() == true" implies non-null > |sBtCoreInterface|? Yes, |sBtCoreInterface::Enable| is required to enable Bluetooth. There's no way to enable Bluetooth without calling it first.
Flags: needinfo?(tzimmermann)
Assignee | ||
Comment 17•9 years ago
|
||
Changes since v1: - rebased onto latest m-c
Attachment #8686067 -
Attachment is obsolete: true
Attachment #8689466 -
Flags: review+
Assignee | ||
Comment 18•9 years ago
|
||
Changes since v2: - rebased onto latest m-c - fixed test for |sBtCoreInterface|
Attachment #8687972 -
Attachment is obsolete: true
Attachment #8689468 -
Flags: review+
Comment 19•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/958acda55a11 https://hg.mozilla.org/integration/b2g-inbound/rev/e01293abbc3d https://hg.mozilla.org/integration/b2g-inbound/rev/9bbf22cb4f63 https://hg.mozilla.org/integration/b2g-inbound/rev/489a24c0094b https://hg.mozilla.org/integration/b2g-inbound/rev/64cd192b8d12
Assignee | ||
Comment 20•9 years ago
|
||
Thanks for the review! https://treeherder.mozilla.org/#/jobs?repo=b2g-inbound&revision=64cd192b8d12
Comment 21•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/958acda55a11 https://hg.mozilla.org/mozilla-central/rev/e01293abbc3d https://hg.mozilla.org/mozilla-central/rev/9bbf22cb4f63 https://hg.mozilla.org/mozilla-central/rev/489a24c0094b https://hg.mozilla.org/mozilla-central/rev/64cd192b8d12
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.6 S1 - 11/20
You need to log in
before you can comment on or make changes to this bug.
Description
•