diff options
author | Sonny Sasaka <sonnysasaka@google.com> | 2022-03-09 21:34:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-03-09 21:34:18 +0000 |
commit | 1475d0d26b825d943ea38496a09673a8e86d5537 (patch) | |
tree | 627e56d47b2b71035eb0770827fd9decc544a78e /system/gd/rust/linux/stack/src | |
parent | e1148580b7fa905454ab8ca5b74d4f6767e1c44f (diff) | |
parent | 65ff9dac4c71144c8b10b96a88d17bdf665b81a0 (diff) |
Merge "Floss: Cancel discovery before BREDR pairing/connection"
Diffstat (limited to 'system/gd/rust/linux/stack/src')
-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() { |