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

Commit 0a52cf7f authored by Frédéric Danis's avatar Frédéric Danis
Browse files

Floss: Remove automatic SCO call start

The telephony functions were implemented only for qualification and they
don't care about CRAS at all. But now they should release the SCO
management back to CRAS.

Bug: 299231669
Test: Conduct the following manual tests.
  pair Bluetooth Headset
  load https://google.git.io/libhidtelephoony/ with Chrome
  click on "Start", select the headset then "Connect"
  "Inputs Reports" and "Output Reports" are correct
  "Hook Switch" and "Ring" test cases are passed
Test: atest bluetooth_test_gd

Change-Id: I43efc81e4437fec203a07935eab868922627d08a
parent 7a53dc18
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -987,8 +987,10 @@ impl BluetoothMedia {
                }
                self.phone_state_change("".into());

                if self.mps_qualification_enabled {
                    debug!("[{}]: Start SCO call due to ATA", DisplayAddress(&addr));
                    self.start_sco_call_impl(addr.to_string(), false, HfpCodecCapability::NONE);
                }
                self.uhid_send_input_report(&addr);
            }
            HfpCallbacks::HangupCall(addr) => {
@@ -2933,6 +2935,7 @@ impl IBluetoothTelephony for BluetoothMedia {
        }
        self.phone_state_change("".into());

        if self.mps_qualification_enabled {
            // Find a connected HFP and try to establish an SCO.
            if let Some(addr) = self.hfp_states.iter().find_map(|(addr, state)| {
                if *state == BthfConnectionState::SlcConnected {
@@ -2944,6 +2947,7 @@ impl IBluetoothTelephony for BluetoothMedia {
                info!("Start SCO call due to call answered");
                self.start_sco_call_impl(addr.to_string(), false, HfpCodecCapability::NONE);
            }
        }

        true
    }