Bug 795458 - a workaround for this bug and fixed a typo, r=qdot
authorEric Chou <echou@mozilla.com>
Sun, 30 Sep 2012 10:45:21 +0800
changeset 108670 e6fb0f8197f7ea5039eb1f4105d0ba02cbb0a6d4
parent 108669 fcac73861b0337885c682314a63b79872b11f22b
child 108671 56680410dde6cba71b8614112813743a016229e0
push id23577
push usermlamouri@mozilla.com
push dateSun, 30 Sep 2012 12:19:29 +0000
treeherdermozilla-central@0df33af01cee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs795458
milestone18.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 795458 - a workaround for this bug and fixed a typo, r=qdot
dom/bluetooth/BluetoothService.cpp
dom/bluetooth/linux/BluetoothDBusService.cpp
--- a/dom/bluetooth/BluetoothService.cpp
+++ b/dom/bluetooth/BluetoothService.cpp
@@ -758,17 +758,17 @@ BluetoothService::Notify(const Bluetooth
   } else if (aData.name().EqualsLiteral("Authorize")) {
     NS_ASSERTION(arr.Length() == 2, "Authorize: Wrong length of parameters");
     type.AssignLiteral("bluetooth-authorize");
   } else if (aData.name().EqualsLiteral("Cancel")) {
     NS_ASSERTION(arr.Length() == 0, "Cancel: Wrong length of parameters");
     type.AssignLiteral("bluetooth-cancel");
   } else if (aData.name().EqualsLiteral("PairedStatusChanged")) {
     NS_ASSERTION(arr.Length() == 1, "PairedStatusChagned: Wrong length of parameters");
-    type.AssignLiteral("bluetooth-pairingstatuschanged");
+    type.AssignLiteral("bluetooth-pairedstatuschanged");
   } else {
 #ifdef DEBUG
     nsCString warningMsg;
     warningMsg.AssignLiteral("Not handling service signal: ");
     warningMsg.Append(NS_ConvertUTF16toUTF8(aData.name()));
     NS_WARNING(warningMsg.get());
 #endif
   }
--- a/dom/bluetooth/linux/BluetoothDBusService.cpp
+++ b/dom/bluetooth/linux/BluetoothDBusService.cpp
@@ -1259,16 +1259,26 @@ EventFilter(DBusConnection* aConn, DBusM
                         sDeviceProperties,
                         ArrayLength(sDeviceProperties));
     if (v.get_ArrayOfBluetoothNamedValue()[0].name().EqualsLiteral("Paired")) {
       // transfer signal to BluetoothService and
       // broadcast system message of bluetooth-pairingstatuschanged
       signalName = NS_LITERAL_STRING("PairedStatusChanged");
       signalPath = NS_LITERAL_STRING(LOCAL_AGENT_PATH);
       v.get_ArrayOfBluetoothNamedValue()[0].name() = NS_LITERAL_STRING("paired");
+    } else {
+     /*
+      * This is a workaround for Bug 795458. We avoid sending events whose
+      * signalPath is "device object path" (formatted as "/org/bluez/
+      * [pid]/hci0/dev_xx_xx_xx_xx_xx_xx". It's because those corresponding
+      * BluetoothDevice objects may have been garbage-collected. Since we
+      * don't need to know any propert changed except 'paired', this should
+      * work for now.
+      */
+      return DBUS_HANDLER_RESULT_HANDLED;
     }
   } else if (dbus_message_is_signal(aMsg, DBUS_MANAGER_IFACE, "AdapterAdded")) {
     const char* str;
     if (!dbus_message_get_args(aMsg, &err,
                                DBUS_TYPE_OBJECT_PATH, &str,
                                DBUS_TYPE_INVALID)) {
       LOG_AND_FREE_DBUS_ERROR_WITH_MSG(&err, aMsg);
       errorStr.AssignLiteral("Cannot parse manager path!");