summaryrefslogtreecommitdiff
path: root/android/bluetooth.c
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-09-02 13:51:36 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-09-02 17:38:39 +0200
commit2a732550cb288dacfca6f345fcfceba153f8ef41 (patch)
treee91cc1521e5428b8734ca9f119db7974caeb23f9 /android/bluetooth.c
parent5fbba47811028347ce2fd925680d28ea56a00e6e (diff)
downloadbluez-2a732550cb288dacfca6f345fcfceba153f8ef41.tar.gz
android/bluetooth: Fix handling paring related events
As it turns out it is possible that kernel send to user space mgmt events related to pairing before device connected event. In such case BfA was dropping such event because he does not know device. With this patch, if device is not in the cache, BfA will create it. Issue triggered by test: "Bluetooth Accept Bond - Just Works - Success"
Diffstat (limited to 'android/bluetooth.c')
-rw-r--r--android/bluetooth.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 2f3a6d6c9..211e0600b 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1242,7 +1242,7 @@ static void new_link_key_callback(uint16_t index, uint16_t length,
return;
}
- dev = find_device(&ev->key.addr.bdaddr);
+ dev = get_device(&ev->key.addr.bdaddr, ev->key.addr.type);
if (!dev)
return;
@@ -1337,7 +1337,7 @@ static void user_confirm_request_callback(uint16_t index, uint16_t length,
ba2str(&ev->addr.bdaddr, dst);
DBG("%s confirm_hint %u", dst, ev->confirm_hint);
- dev = find_device(&ev->addr.bdaddr);
+ dev = get_device(&ev->addr.bdaddr, ev->addr.type);
if (!dev)
return;
@@ -1365,7 +1365,7 @@ static void user_passkey_request_callback(uint16_t index, uint16_t length,
ba2str(&ev->addr.bdaddr, dst);
DBG("%s", dst);
- dev = find_device(&ev->addr.bdaddr);
+ dev = get_device(&ev->addr.bdaddr, ev->addr.type);
if (!dev)
return;
@@ -2307,7 +2307,7 @@ static void new_csrk_callback(uint16_t index, uint16_t length,
}
ba2str(&ev->key.addr.bdaddr, dst);
- dev = find_device(&ev->key.addr.bdaddr);
+ dev = get_device(&ev->key.addr.bdaddr, ev->key.addr.type);
if (!dev)
return;
@@ -2382,7 +2382,7 @@ static void new_irk_callback(uint16_t index, uint16_t length,
DBG("new IRK for %s, RPA %s", dst, rpa);
if (!bacmp(&ev->rpa, BDADDR_ANY)) {
- dev = find_device(&addr->bdaddr);
+ dev = get_device(&addr->bdaddr, addr->type);
if (!dev)
return;
} else {