summaryrefslogtreecommitdiff
path: root/android/bluetooth.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-05-18 13:53:58 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-05-19 10:17:25 +0200
commitb9d6d37fd56df25dcc90f050ae1eb33e20df73a8 (patch)
tree44d1972abadfab4a3fab9d282b93bdb9f9856620 /android/bluetooth.c
parent033024822b2717e077bc24d12b2ea12f719f06f6 (diff)
downloadbluez-b9d6d37fd56df25dcc90f050ae1eb33e20df73a8.tar.gz
android/bluetooth: Fix unpairing dual mode device
If device is paired on LE and BR/EDR it should be unpaired on both bearers.
Diffstat (limited to 'android/bluetooth.c')
-rw-r--r--android/bluetooth.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 4b2b1a20a..86f6cf443 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -3430,13 +3430,26 @@ static void handle_remove_bond_cmd(const void *buf, uint16_t len)
goto failed;
}
- cp.addr.type = select_device_bearer(dev);
+ if (dev->le_paired) {
+ cp.addr.type = dev->bdaddr_type;
- if (mgmt_send(mgmt_if, MGMT_OP_UNPAIR_DEVICE, adapter.index,
- sizeof(cp), &cp, unpair_device_complete,
- NULL, NULL) == 0) {
- status = HAL_STATUS_FAILED;
- goto failed;
+ if (mgmt_send(mgmt_if, MGMT_OP_UNPAIR_DEVICE, adapter.index,
+ sizeof(cp), &cp, unpair_device_complete,
+ NULL, NULL) == 0) {
+ status = HAL_STATUS_FAILED;
+ goto failed;
+ }
+ }
+
+ if (dev->bredr_paired) {
+ cp.addr.type = BDADDR_BREDR;
+
+ if (mgmt_send(mgmt_if, MGMT_OP_UNPAIR_DEVICE, adapter.index,
+ sizeof(cp), &cp, unpair_device_complete,
+ NULL, NULL) == 0) {
+ status = HAL_STATUS_FAILED;
+ goto failed;
+ }
}
status = HAL_STATUS_SUCCESS;