[b2g-bluetooth] Add events onconnected and ondisconnected in BluetoothDevice

RESOLVED FIXED in mozilla17

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gyeh, Assigned: gyeh)

Tracking

unspecified
mozilla17
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
As discussed in Bug778640, we'd like to create onConnected and onDisconnected events via event generator. The difference here is that, these events are implemented in BluetoothDevice rather than BluetoothApapter because only bluetooth device addresses are maintained in BluetoothAdapter. For Gaia side, we have to call getPairedDevices() first and an array of BluetoothDevices will be returned back, and then listen to onConnected and onDisconnected events.
(Assignee)

Updated

5 years ago
Summary: [b2g-bluetooth] Create deviceconnected event and devicedisconnected with event generator → [b2g-bluetooth] Add events onconnected and ondisconnected in BluetoothDevice
(Assignee)

Comment 1

5 years ago
Created attachment 653711 [details] [diff] [review]
v1: Add events onconnected and ondisconnected  in BluetoothDevice

For gaia side, getPairedDevices() first and then listen every device for event onconnected and event ondisconnected.
Attachment #653711 - Flags: review?(kyle)
Attachment #653711 - Flags: review?(kyle) → review+
Blocks: 727618
(Assignee)

Comment 2

5 years ago
Created attachment 654050 [details] [diff] [review]
Final version: Add events onconnected and ondisconnected  in BluetoothDevice, r=qdot
Attachment #653711 - Attachment is obsolete: true
Attachment #654050 - Flags: superreview?(mrbkap)
Comment on attachment 654050 [details] [diff] [review]
Final version: Add events onconnected and ondisconnected  in BluetoothDevice, r=qdot

Review of attachment 654050 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bluetooth/nsIDOMBluetoothDevice.idl
@@ +16,5 @@
>    readonly attribute bool connected;
>    readonly attribute bool paired;
>    attribute nsIDOMEventListener onpropertychanged;
> +  attribute nsIDOMEventListener onconnected;
> +  attribute nsIDOMEventListener ondisconnected;

Need to bump the IID for this interface.
Attachment #654050 - Flags: superreview?(mrbkap) → superreview+
(Assignee)

Comment 4

5 years ago
Created attachment 654498 [details] [diff] [review]
Final version: Add events onconnected and ondisconnected  in BluetoothDevice, r=qdot, sr=mrbkap
Attachment #654050 - Attachment is obsolete: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/167fdd4db264
https://hg.mozilla.org/mozilla-central/rev/167fdd4db264
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.