Bug 942104 - Fire event 'ondiscoverystatechanged' (bluez), r=gyeh

This commit is contained in:
Eric Chou 2013-11-30 20:20:18 +08:00
Родитель 3c5f74ef5d
Коммит 74a7ecb704
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -1512,6 +1512,20 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
errorStr,
sAdapterProperties,
ArrayLength(sAdapterProperties));
BluetoothNamedValue& property = v.get_ArrayOfBluetoothNamedValue()[0];
if (property.name().EqualsLiteral("Discovering")) {
bool isDiscovering = property.value();
BluetoothSignal signal(NS_LITERAL_STRING(DISCOVERY_STATE_CHANGED_ID),
NS_LITERAL_STRING(KEY_ADAPTER),
isDiscovering);
nsRefPtr<DistributeBluetoothSignalTask>
t = new DistributeBluetoothSignalTask(signal);
if (NS_FAILED(NS_DispatchToMainThread(t))) {
BT_WARNING("Failed to dispatch to main thread!");
}
}
} else if (dbus_message_is_signal(aMsg, DBUS_DEVICE_IFACE,
"PropertyChanged")) {
ParsePropertyChange(aMsg,