fix(audio): clear BT SCO communication device on call end
Without clearCommunicationDevice(), the BT headset stays locked in SCO mode after the call. Media playback (video, music) can't route to BT A2DP, requiring a device reboot to restore normal audio. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1500,9 +1500,14 @@ impl CallEngine {
|
|||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
{
|
{
|
||||||
crate::wzp_native::audio_stop();
|
crate::wzp_native::audio_stop();
|
||||||
// Restore MODE_NORMAL so other apps' audio (music, etc.)
|
// Release the BT SCO communication device so Android can
|
||||||
// routes normally again. Without this, the system stays in
|
// route media (video, music) back to BT A2DP. Without this,
|
||||||
// communication mode and BT A2DP music goes to earpiece.
|
// setCommunicationDevice locks BT to SCO mode and other apps
|
||||||
|
// can't use the headset for media playback until reboot.
|
||||||
|
if let Err(e) = crate::android_audio::stop_bluetooth_sco() {
|
||||||
|
tracing::warn!("stop_bluetooth_sco on call end failed: {e}");
|
||||||
|
}
|
||||||
|
// Restore MODE_NORMAL so other apps' audio routes normally.
|
||||||
if let Err(e) = crate::android_audio::set_audio_mode_normal() {
|
if let Err(e) = crate::android_audio::set_audio_mode_normal() {
|
||||||
tracing::warn!("set_audio_mode_normal failed: {e}");
|
tracing::warn!("set_audio_mode_normal failed: {e}");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user