Last Comment Bug 783934 - [b2g-bluetooth] Add events onconnected and ondisconnected in BluetoothDevice
: [b2g-bluetooth] Add events onconnected and ondisconnected in BluetoothDevice
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Gina Yeh [:gyeh] [:ginayeh]
:
Mentors:
Depends on:
Blocks: b2g-bluetooth
  Show dependency treegraph
 
Reported: 2012-08-19 20:28 PDT by Gina Yeh [:gyeh] [:ginayeh]
Modified: 2012-08-23 19:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1: Add events onconnected and ondisconnected in BluetoothDevice (3.84 KB, patch)
2012-08-21 04:07 PDT, Gina Yeh [:gyeh] [:ginayeh]
kyle: review+
Details | Diff | Splinter Review
Final version: Add events onconnected and ondisconnected in BluetoothDevice, r=qdot (3.75 KB, patch)
2012-08-21 19:08 PDT, Gina Yeh [:gyeh] [:ginayeh]
mrbkap: superreview+
Details | Diff | Splinter Review
Final version: Add events onconnected and ondisconnected in BluetoothDevice, r=qdot, sr=mrbkap (4.41 KB, patch)
2012-08-22 20:10 PDT, Gina Yeh [:gyeh] [:ginayeh]
no flags Details | Diff | Splinter Review

Description Gina Yeh [:gyeh] [:ginayeh] 2012-08-19 20:28:10 PDT
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.
Comment 1 Gina Yeh [:gyeh] [:ginayeh] 2012-08-21 04:07:24 PDT
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.
Comment 2 Gina Yeh [:gyeh] [:ginayeh] 2012-08-21 19:08:14 PDT
Created attachment 654050 [details] [diff] [review]
Final version: Add events onconnected and ondisconnected  in BluetoothDevice, r=qdot
Comment 3 Blake Kaplan (:mrbkap) 2012-08-22 14:17:46 PDT
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.
Comment 4 Gina Yeh [:gyeh] [:ginayeh] 2012-08-22 20:10:36 PDT
Created attachment 654498 [details] [diff] [review]
Final version: Add events onconnected and ondisconnected  in BluetoothDevice, r=qdot, sr=mrbkap
Comment 5 Eric Chou [:ericchou] [:echou] 2012-08-22 23:15:38 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/167fdd4db264
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-08-23 19:22:29 PDT
https://hg.mozilla.org/mozilla-central/rev/167fdd4db264

Note You need to log in before you can comment on or make changes to this bug.