Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6591cccb authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Gerrit Code Review
Browse files

Merge "floss: Cancel inquiry before attempting connection"

parents bc315587 04ba436f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1389,6 +1389,11 @@ impl IBluetooth for Bluetooth {
    }

    fn start_discovery(&self) -> bool {
        // Short-circuit to avoid sending multiple start discovery calls.
        if self.is_discovering {
            return true;
        }

        self.intf.lock().unwrap().start_discovery() == 0
    }

@@ -1807,6 +1812,9 @@ impl IBluetooth for Bluetooth {
            metrics::acl_connect_attempt(addr, BtAclState::Connected);
        }

        // Cancel discovery before attempting to connect (or we'll get connection failures).
        self.cancel_discovery();

        // Check all remote uuids to see if they match enabled profiles and connect them.
        let mut has_enabled_uuids = false;
        let uuids = self.get_remote_uuids(device.clone());