summaryrefslogtreecommitdiff
path: root/android/bluetooth.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2015-01-16 15:34:46 +0100
committerSzymon Janc <szymon.janc@tieto.com>2015-01-16 15:54:40 +0100
commitce2bcb20db94036f5ffdf4c41dea8a449e3eb5cf (patch)
tree6d8233cbf8b42b0c476e219fa26fecd21313c013 /android/bluetooth.c
parentd1c0b2c37e10d66ae6361290cc36cc7bb22c78e0 (diff)
downloadbluez-ce2bcb20db94036f5ffdf4c41dea8a449e3eb5cf.tar.gz
android: Fix not updating remote device BR/EDR support correctly
If device that was previously seen only over LE connected over BR/EDR it's type was not properly updated to dual mode. This was affecting PTS TC_DM_BON_BV_01_C test.
Diffstat (limited to 'android/bluetooth.c')
-rw-r--r--android/bluetooth.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/android/bluetooth.c b/android/bluetooth.c
index eff5b08aa..bc09d67f3 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1864,7 +1864,7 @@ static void update_new_device(struct device *dev, int8_t rssi,
}
static void update_device(struct device *dev, int8_t rssi,
- const struct eir_data *eir, uint8_t bdaddr_type)
+ const struct eir_data *eir)
{
uint8_t buf[IPC_MTU];
struct hal_ev_remote_device_props *ev = (void *) buf;
@@ -1880,13 +1880,6 @@ static void update_device(struct device *dev, int8_t rssi,
old_type = get_device_android_type(dev);
- if (bdaddr_type == BDADDR_BREDR) {
- dev->bredr = true;
- } else {
- dev->le = true;
- dev->bdaddr_type = bdaddr_type;
- }
-
new_type = get_device_android_type(dev);
if (old_type != new_type) {
@@ -1961,10 +1954,14 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
dev = get_device(bdaddr, bdaddr_type);
- if (bdaddr_type == BDADDR_BREDR)
+ if (bdaddr_type == BDADDR_BREDR) {
+ dev->bredr = true;
dev->bredr_seen = time(NULL);
- else
+ } else {
+ dev->le = true;
+ dev->bdaddr_type = bdaddr_type;
dev->le_seen = time(NULL);
+ }
/*
* Device found event needs to be send also for known device if this is
@@ -1973,7 +1970,7 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
if (is_new_device(dev, eir.flags, bdaddr_type))
update_new_device(dev, rssi, &eir);
else
- update_device(dev, rssi, &eir, bdaddr_type);
+ update_device(dev, rssi, &eir);
eir_data_free(&eir);