Closed Bug 783934 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: gyeh, Assigned: gyeh)

References

Details

Attachments

(1 file, 2 obsolete files)

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.
Summary: [b2g-bluetooth] Create deviceconnected event and devicedisconnected with event generator → [b2g-bluetooth] 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+
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+
https://hg.mozilla.org/mozilla-central/rev/167fdd4db264
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.