Closed Bug 804474 Opened 8 years ago Closed 8 years ago

[b2g-bluetooth] Null address value in system message of "bluetooth-hfp-status-changed"


(Core :: DOM: Device Interfaces, defect)

Gonk (Firefox OS)
Not set



blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed


(Reporter: gyeh, Assigned: gyeh)



(Whiteboard: [LOE: S])


(1 file, 2 obsolete files)

- Disconnect with a bluetooth headset

Expected Behaviour:
- Send a system message with device address

Actual Behaviour:
- Address is null
We should send system messages to notify settings app when connection status changes.

No matter we try to connect with a headset or a headset connects with us, system messages are successfully sent out in OnConnectSuccess().

However, when the headset disconnect with us, we'll get null value from GetSocketAddr(), resulting in null address in system message and sending to settings app.

Kyle, is there any way we can get address in OnDisconnect()? Or we still have to cache it in BluetoothHfpManager?
(In reply to Gina Yeh from comment #1)
> Kyle, is there any way we can get address in OnDisconnect()? Or we still
> have to cache it in BluetoothHfpManager?

Yeah, I can probably cache it before removing the SocketImpl and ship it over.
Assignee: nobody → kyle
Whiteboard: [LOE: S]
I just realized... We can only have one thing connected to a manager, and really, to a UnixSocketConsumer, at a time. Why not keep the address in a member when you get it on connect, then use that address when OnDisconnect is called? Then there's no need to change the UnixSocket class, which shouldn't need to care about this anyways.
Assignee: kyle → gyeh
Comment on attachment 674996 [details] [diff] [review]
Patch 1 (v1): Cache device path as a member of BluetoothHfpManager

Review of attachment 674996 [details] [diff] [review]:

r=me with nits addressed

::: dom/bluetooth/BluetoothHfpManager.cpp
@@ +315,5 @@
>    InfallibleTArray<BluetoothNamedValue> parameters;
>    type.AssignLiteral("bluetooth-hfp-status-changed");
>    name.AssignLiteral("connected");
> +  switch (GetConnectionStatus()) {

Nit: Are we going to be adding more cases here? If not, why not just make this an if?
Attachment #674996 - Flags: review?(kyle) → review+
Attached patch Final version, r=qdot (obsolete) — Splinter Review
With nit picked
Attachment #674996 - Attachment is obsolete: true
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.