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

Commit 2ab3c678 authored by Yun-Hao Chung's avatar Yun-Hao Chung
Browse files

Floss: Auto reply Just Works pairing

This makes Floss auto reply ssp request if it is Just-work pairing.
For incoming pairing, auto reject it. For outgoing pairing, auto accept
it.

This doesn't really change the behavior since we also reject/accept in
the chrome anyway.

Bug: 304925828
Test: tested with another chromebooks and verify both incoming and
outgoing works as expected. Also check dbus-monitor to verify there is
no SspRequest callback.
Test: mma -j
Tag: #floss

Change-Id: Ib3f826727f59e449d6c45b12a153388395391a2f
parent 165e1325
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| {