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

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

Floss: Fix unable to stream A2DP on telephony use release

When an application disconnects from UHID all pending calls should be
removed to allow A2DP streaming.

Bug: 311116520
Test: Conduct the following manual tests
  pair Bluetooth Headset
  Open youtube and play music
  start Google meet call
  add Headset to Meet call control
  remove call control permissions on Headset
  switch Microphone to internal
  audio streaming is switch back to A2DP
Test: atest bluetooth_test_gd

Change-Id: Iecf97a229b28b4fd0c03501011655ac8a34e9048
parent ec94418d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1273,6 +1273,14 @@ impl BluetoothMedia {
        };

        debug!("[{}]: UHID: Telephony use: {}", DisplayAddress(&addr), state);
        if state == false {
            // As there's a HID call for each WebHID call, even if it has been answered in the app
            // or pre-exists, and that an app which disconnects from WebHID may not have trigger
            // the UHID_OUTPUT_NONE, we need to remove all pending HID calls on telephony use
            // release to keep lower HF layer in sync and not prevent A2DP streaming
            self.hangup_call_impl();
            self.phone_state_change("".into());
        }
        self.telephony_callbacks.lock().unwrap().for_all_callbacks(|callback| {
            callback.on_telephony_use(address.to_string(), state);
        });