Closed Bug 804474 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla19
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed

People

(Reporter: gyeh, Assigned: gyeh)

References

Details

(Whiteboard: [LOE: S])

Attachments

(1 file, 2 obsolete files)

Repro:
- 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
https://hg.mozilla.org/mozilla-central/rev/e13558629f12
Status: NEW → RESOLVED
Closed: 7 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.