Skip to content

autoswitch-bluetooth-profile: Always destroy the restore timeout source before switching

Currently, the bluetooth profile autoswitch logic does not cancel any pending restore timeout source when we the device is already set to HSP/HFP or has already an input route. This can cause infinite loops for applications that create and destroy capture streams quickly.

This MR always destroys the restore timeout source when we want to switch to HSP/HFP profile, even if the device is already set to HSP/HFP or has already an input route. Apart from this, it also destroys the pending restore timeout source when we are creating a new one.

Related to #617 and !630

Merge request reports

Loading