summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang zhengguang <zhengguang.zhang@intel.com>2013-11-21 10:18:27 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2013-11-21 13:50:30 +0800
commita530ebe0ed32fd3d4d8fe1c698ccf919d1e6256e (patch)
treeace55ab85da1112a2c205d96965b58892c15d52e
parentd66436126d39eebb730b3734f4ff160931a03316 (diff)
downloadconnman-a530ebe0ed32fd3d4d8fe1c698ccf919d1e6256e.tar.gz
connman-a530ebe0ed32fd3d4d8fe1c698ccf919d1e6256e.tar.bz2
connman-a530ebe0ed32fd3d4d8fe1c698ccf919d1e6256e.zip
Fix bluetooth enable fail issue for bluez 5.xsubmit/tizen/20131122.011455accepted/tizen/20131122.203502
Root cause: When ConnMan tries to enable bluetooth technology, firstly 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, and in current ConnMan bluetooth plugin for Bluez 5.x, 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. Change-Id: Iaba867daf228ce785d71b6e5358ec3f26ccac425 Signed-off-by: Zhang zhengguang <zhengguang.zhang@intel.com>
-rw-r--r--plugins/bluetooth.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index b5e310e1..8bbf2ad1 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -597,13 +597,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 == TRUE)
- 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)