Bug 1060216 - [Bluedroid] Distribute "PropertyChanged" signal to notify BluetoothAdapter when discovery state changed. r=shuang
authorJamin Liu <jaliu@mozilla.com>
Fri, 29 Aug 2014 02:10:00 -0400
changeset 223992 803b392f69724769ee7d30a7c7655ae454b7f000
parent 223991 09b7bd9254d5888a81e01535c9eb6fa5c862b4e4
child 223993 754df336ea3bacf43815174ccc08807c4e9ca8d1
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1060216
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1060216 - [Bluedroid] Distribute "PropertyChanged" signal to notify BluetoothAdapter when discovery state changed. r=shuang
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -1490,16 +1490,24 @@ BluetoothServiceBluedroid::DiscoveryStat
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   bool isDiscovering = (aState == true);
 
   DistributeSignal(
     BluetoothSignal(NS_LITERAL_STRING(DISCOVERY_STATE_CHANGED_ID),
                     NS_LITERAL_STRING(KEY_ADAPTER), isDiscovering));
+
+  // Distribute "PropertyChanged" signal to notice adapter this change since
+  // Bluedroid don' treat "discovering" as a property of adapter.
+  InfallibleTArray<BluetoothNamedValue> props;
+  BT_APPEND_NAMED_VALUE(props, "Discovering", BluetoothValue(isDiscovering));
+  DistributeSignal(BluetoothSignal(NS_LITERAL_STRING("PropertyChanged"),
+                                   NS_LITERAL_STRING(KEY_ADAPTER),
+                                   BluetoothValue(props)));
 }
 
 void
 BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr,
                                                   const nsAString& aBdName,
                                                   uint32_t aCod)
 {
   MOZ_ASSERT(NS_IsMainThread());