diff options
author | Sonny Sasaka <sonnysasaka@google.com> | 2022-03-09 22:37:57 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-03-09 22:37:57 +0000 |
commit | cd640a49ff6640ece8aa15f015c5fe94d9a5b01c (patch) | |
tree | 607f486e863b394d5f21a3d663166b574fa50fc4 /system/gd/rust/linux/stack | |
parent | 8495904c65a64ba0a1a004ca7512810cb54c0ad2 (diff) | |
parent | 64d04b61a11ff4ffeeca42e6df4991cdf6ad2ae6 (diff) |
Merge "Floss: Cancel discovery before BREDR pairing/connection" am: 1475d0d26b am: d7b1ae4c89 am: 64d04b61a1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2014497
Change-Id: I1af583e26f2a04973267dd98cd35f6ce54cb986d
Diffstat (limited to 'system/gd/rust/linux/stack')
-rw-r--r-- | system/gd/rust/linux/stack/src/bluetooth.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/system/gd/rust/linux/stack/src/bluetooth.rs b/system/gd/rust/linux/stack/src/bluetooth.rs index 6aa3529873..e7bff62c5c 100644 --- a/system/gd/rust/linux/stack/src/bluetooth.rs +++ b/system/gd/rust/linux/stack/src/bluetooth.rs @@ -949,6 +949,10 @@ impl IBluetooth for Bluetooth { } let address = addr.unwrap(); + + // BREDR connection won't work when Inquiry is in progress. + self.cancel_discovery(); + self.intf.lock().unwrap().create_bond(&address, transport) == 0 } @@ -1153,6 +1157,9 @@ impl IBluetooth for Bluetooth { return false; } + // BREDR connection won't work when Inquiry is in progress. + self.cancel_discovery(); + // Check all remote uuids to see if they match enabled profiles and connect them. let uuids = self.get_remote_uuids(device.clone()); for uuid in uuids.iter() { |