Closed
Bug 1026454
Opened 12 years ago
Closed 12 years ago
Fire PropertyChanged when discovery state changes
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ben.tian, Assigned: ben.tian)
Details
(Whiteboard: [webbt-api])
Attachments
(1 file, 3 obsolete files)
PropertyChanged of BluetoothAdapter should be fired when discovery state changes.
| Assignee | ||
Updated•12 years ago
|
Whiteboard: [webbt-api]
| Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → btian
| Assignee | ||
Comment 2•12 years ago
|
||
| Assignee | ||
Comment 3•12 years ago
|
||
Changes:
- Fire PropertyChanged when discovery state changes
- Revise macro BT_APPEND_NAMED_VALUE to handle atomic variables
- set mState=Disabled in BluetoothAdapter
- clean compilation warning by setting MOZ_FINAL.
Attachment #8441295 -
Attachment is obsolete: true
Attachment #8441297 -
Attachment is obsolete: true
Attachment #8442004 -
Flags: review?(echou)
Comment 4•12 years ago
|
||
Comment on attachment 8442004 [details] [diff] [review]
Patch 1 (v2): Fire PropertyChanged when discovery state changes
Review of attachment 8442004 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with nits addressed.
::: dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.cpp
@@ +155,5 @@
> BT_APPEND_NAMED_VALUE(props, "Name", sAdapterBdName);
> BT_APPEND_NAMED_VALUE(props, "Address", sAdapterBdAddress);
> + if (sAdapterDiscoverable) {
> + sAdapterDiscoverable = false;
> + BT_APPEND_NAMED_VALUE(props, "Discoverable", sAdapterDiscoverable);
I would prefer using a constant instead of a variable in such case to avoid potential access to the variable, especially when sAdapterDiscoverable and sAdapterDiscovering are Atomic<bool> which may take time to lock/unlock.
@@ +583,5 @@
> +
> + BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
> + NS_LITERAL_STRING(KEY_ADAPTER), props);
> + BluetoothService* bs = BluetoothService::Get();
> + NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
Please do this check at the beginning of the function so that we can save some time if bs is null.
Attachment #8442004 -
Flags: review?(echou) → review+
| Assignee | ||
Comment 5•12 years ago
|
||
Attachment #8442004 -
Attachment is obsolete: true
| Assignee | ||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•