Closed
Bug 790133
Opened 12 years ago
Closed 12 years ago
[b2g-bluetooth] Fire devicecreated event with a BluetoothDevice
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: gyeh, Assigned: gyeh)
References
Details
(Whiteboard: [LOE:S] )
Attachments
(1 file, 3 obsolete files)
This is a followup of Bug 789014. When there's a random device try to pair with us, we need to create an actual BluetoothDevice first, and pass it to Gaia with a ondevicecreated event.
Assignee | ||
Comment 1•12 years ago
|
||
When Service gets "DeviceCreated", we create another thread to get device properties, and send the dict back to adapter which fires ondevicecreated event with an instance of BluetoothDevice.
Attachment #660343 -
Flags: review?(kyle)
Comment 2•12 years ago
|
||
Comment on attachment 660343 [details] [diff] [review] v1: Fire devicecreated event with a BluetoothDevice Review of attachment 660343 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bluetooth/linux/BluetoothDBusService.cpp @@ +1243,5 @@ > + mDevicePath(aDevicePath), > + mSignalPath(aSignalPath) > + { > + MOZ_ASSERT(NS_IsMainThread()); > + MOZ_ASSERT(aDevicePath && aSignalPath); Nit: These are references, so not sure what you're asserting here?
Attachment #660343 -
Flags: review?(kyle) → review+
Assignee | ||
Updated•12 years ago
|
Attachment #660343 -
Flags: superreview?(mrbkap)
Assignee | ||
Comment 3•12 years ago
|
||
Oops! I'll remove the assertion in the final version patch. Thanks!
Comment 4•12 years ago
|
||
Comment on attachment 660343 [details] [diff] [review] v1: Fire devicecreated event with a BluetoothDevice Review of attachment 660343 [details] [diff] [review]: ----------------------------------------------------------------- sr=me with a couple of nits picked and one real comment fixed. ::: dom/bluetooth/BluetoothAdapter.cpp @@ +315,5 @@ > + NS_NewDOMBluetoothDeviceEvent(getter_AddRefs(event), nullptr, nullptr); > + > + nsCOMPtr<nsIDOMBluetoothDeviceEvent> e = do_QueryInterface(event); > + e->InitBluetoothDeviceEvent(NS_LITERAL_STRING("devicecreated"), > + false, false, device); Nit: this looks misindented. ::: dom/bluetooth/linux/BluetoothDBusService.cpp @@ +919,5 @@ > + NS_WARNING("BluetoothService not available!"); > + } > + > + if (NS_FAILED(bs->GetDevicePropertiesInternal(v, signalPath))) { > + NS_WARNING("get properties failed"); Nit: looks like some tabs crept in here. @@ +1277,5 @@ > + if (msg) { > + dbus_message_unref(msg); > + } > + > + BluetoothSignal signal(NS_ConvertUTF8toUTF16("DeviceCreated"), This should be NS_LITERAL_STRING.
Attachment #660343 -
Flags: superreview?(mrbkap) → superreview+
Assignee | ||
Comment 6•12 years ago
|
||
try server: https://tbpl.mozilla.org/?tree=Try&rev=2cf0e556bf34
Comment 8•12 years ago
|
||
Backed out for failing to compile on B2G: https://hg.mozilla.org/integration/mozilla-inbound/rev/c97bb39c2ea6
Assignee | ||
Comment 9•12 years ago
|
||
The old patch has been out-dated since the ipc patch has been landed, so I changed thee patch a little bit to fit in the current code base. Please help me to check, thanks.
Attachment #661088 -
Attachment is obsolete: true
Attachment #661449 -
Flags: review?(kyle)
Comment 10•12 years ago
|
||
Comment on attachment 661449 [details] [diff] [review] v3: Fire devicecreated event with a BluetoothDevice Review of attachment 661449 [details] [diff] [review]: ----------------------------------------------------------------- Looks good code-wise, at least in-process, need to file a followup for OOP. Have you tried running it with the settings app OOP'd just to make sure it doesn't crash? (Go into gaia/apps/system/js/window-manager.js, search for "Settings", it'll be an entry in the oop-blacklist or something like that, comment out that line, rebuild gaia)
Attachment #661449 -
Flags: review?(kyle) → review+
Assignee | ||
Comment 11•12 years ago
|
||
try server: https://tbpl.mozilla.org/?tree=Try&rev=10d6ba9b8b21
Assignee | ||
Comment 12•12 years ago
|
||
Attachment #661449 -
Attachment is obsolete: true
Assignee | ||
Comment 13•12 years ago
|
||
try server: https://tbpl.mozilla.org/?tree=Try&rev=fa8a0263abc0
Comment 15•12 years ago
|
||
Backout 5796eacef43c (bug 790133) for B2G compilation failures again https://hg.mozilla.org/integration/mozilla-inbound/rev/6f6429620051 Talked with Gina, and we think this is because I didn't push the right patch but pushed former one. Sorry about this.
Assignee | ||
Updated•12 years ago
|
Whiteboard: [LOE:S]
Comment 17•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/20200b3d443e
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in
before you can comment on or make changes to this bug.
Description
•