diff options
author | Zhang zhengguang <zhengguang.zhang@intel.com> | 2013-12-10 17:09:38 +0800 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-12-17 12:30:30 +0200 |
commit | df66c9c57cbb05ecfcf7b0e7108d2ee63c2dea10 (patch) | |
tree | 3467264839c87e183f25123c5a584d819db8ed00 /plugins/bluetooth.c | |
parent | 3bba8c73f50ed458979ae3b8faecc5439b55f22e (diff) | |
download | connman-df66c9c57cbb05ecfcf7b0e7108d2ee63c2dea10.tar.gz |
bluetooth: Fix failure when enabling Bluez 5.x adapter
Root cause:
When ConnMan tries to enable bluetooth technology, first it will
send RFkill unblock event to kernel, then call dbus method to enable
bluetooth device. When bluez receives the RFkill event, it will power
on the device immediately, and sends PropertyChanged message to
ConnMan.
In ConnMan, the device powered state is updated in device enable dbus
reply callback function, but ConnMan receives PropertyChanged message
before device enable dbus reply. In current ConnMan Bluez 5.x
bluetooth plugin, when handling PropertyChanged message, it finds the
adapter state(enabled) is different with the device state ConnMan
stores(disabled), it will disable the bluetooth device.
Solution:
In ConnMan bluetooth plugin for Bluez 5.x, when ConnMan finds the
adapter state is different with the device state ConnMan stores,
update device state in ConnMan to the adapter state.
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r-- | plugins/bluetooth.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 59e6dba5..2c7e08aa 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -605,13 +605,8 @@ static void adapter_property_change(GDBusProxy *proxy, const char *name, DBG("device %p %s device powered %d adapter powered %d", device, path, device_powered, adapter_powered); - if (device_powered != adapter_powered) { - DBG("powering adapter"); - if (device_powered) - bluetooth_device_enable(device); - else - bluetooth_device_disable(device); - } + if (device_powered != adapter_powered) + connman_device_set_powered(device, adapter_powered); } static void device_free(gpointer data) |