Closed
Bug 791650
Opened 9 years ago
Closed 9 years ago
[b2g-bluetooth] 'Connected' attribute in device should a 2-byte array
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: gyeh, Assigned: gyeh)
Details
(Whiteboard: [LOE:S])
Attachments
(1 file, 3 obsolete files)
The BlueZ has been updated last month and the 'Connected' attribute in device is changed into an 2-byte array, instead of a boolean value. Please refer to the log under B2G/external/bluetooth/bluez. The value of first byte is 0 when the device is disconnected and is 1 when the device is connected. The second byte is reserved for disconnection reason.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #661758 -
Flags: review?(kyle)
Assignee | ||
Updated•9 years ago
|
Whiteboard: [LOE:S]
Comment 2•9 years ago
|
||
(In reply to Gina Yeh from comment #0) > The BlueZ has been updated last month and the 'Connected' attribute in > device is changed into an 2-byte array, instead of a boolean value. Please > refer to the log under B2G/external/bluetooth/bluez. > > The value of first byte is 0 when the device is disconnected and is 1 when > the device is connected. The second byte is reserved for disconnection > reason. Add more information here. Today we found that the process of GetPairedDevices did not fire req.onsuccess(), so gaia couldn't get correct device objects, and that's what this issue is about. When configuring B2G for otoro, the default remote repo of BlueZ is not AOSP but CodeAurora. There is a revision of device.c of BlueZ in August, and it changed the type of property "Connected" from boolean to a 2-byte array, like Gina mentioned above. So we either not to pull code from CodeAurora or revise for it. This "Connected" property represents low-level ACL connection. Currently, we don't really care about the reason why connection lost.
Comment 3•9 years ago
|
||
Comment on attachment 661758 [details] [diff] [review] v1: 'Connected' attribute in device should a 2-byte array Review of attachment 661758 [details] [diff] [review]: ----------------------------------------------------------------- Ok, pretty obvious why we need this, but landing it irrevocably breaks desktop. Do we possibly want platform guards here, i.e. check for MOZ_WIDGET_GONK to use array, otherwise keep it a boolean? ::: dom/bluetooth/BluetoothDevice.cpp @@ +115,5 @@ > } else if (name.EqualsLiteral("Icon")) { > mIcon = value.get_nsString(); > } else if (name.EqualsLiteral("Connected")) { > + InfallibleTArray<nsString> arr = value.get_ArrayOfnsString(); > + mConnected = arr[0][0] - '0'; == '1' instead of - '0', easier to understand among other things.
Attachment #661758 -
Flags: review?(kyle)
Assignee | ||
Comment 4•9 years ago
|
||
This patch follows Comment 3. MOZ_WIDGET_GONK is checked for using array for 'Connected' attribute. Otherwise, a boolean value is expected.
Attachment #661758 -
Attachment is obsolete: true
Attachment #662079 -
Flags: review?(kyle)
Assignee | ||
Comment 5•9 years ago
|
||
Add uint8_t[] in BluetoothValue for byte array.
Attachment #662079 -
Attachment is obsolete: true
Attachment #662079 -
Flags: review?(kyle)
Attachment #662105 -
Flags: review?(kyle)
Comment 6•9 years ago
|
||
Comment on attachment 662105 [details] [diff] [review] v3: 'Connected' attribute in device should a 2-byte array Review of attachment 662105 [details] [diff] [review]: ----------------------------------------------------------------- Awesome. Looks good, and should keep us safe on both platforms. ::: dom/bluetooth/BluetoothDevice.cpp @@ +116,5 @@ > mIcon = value.get_nsString(); > } else if (name.EqualsLiteral("Connected")) { > +#ifdef MOZ_WIDGET_GONK > + // Connected is an 2-byte array > + // arr[0]: boolean value, true means connected, flase means disconnected super-nit: false
Attachment #662105 -
Flags: review?(kyle) → review+
Assignee | ||
Comment 7•9 years ago
|
||
Try server: https://tbpl.mozilla.org/?tree=Try&rev=26d886eb502b
Attachment #662105 -
Attachment is obsolete: true
Comment 9•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c9c8d79d3419
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in
before you can comment on or make changes to this bug.
Description
•