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

Commit 09164c7b authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Gerrit Code Review
Browse files

Merge "Floss: Auto reply Just Works pairing" into main

parents 527d3f41 2ab3c678
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1492,6 +1492,16 @@ impl BtifBluetoothCallbacks for Bluetooth {
        variant: BtSspVariant,
        passkey: u32,
    ) {
        // Accept the Just-Works pairing that we initiated, reject otherwise.
        if variant == BtSspVariant::Consent {
            let initiated_by_us = Some(remote_addr.clone()) == self.active_pairing_address;
            self.set_pairing_confirmation(
                BluetoothDevice::new(remote_addr.to_string(), remote_name.clone()),
                initiated_by_us,
            );
            return;
        }

        // Currently this supports many agent because we accept many callbacks.
        // TODO(b/274706838): We need a way to select the default agent.
        self.callbacks.for_all_callbacks(|callback| {