spa: bluez: backend-native: Fix CIEV call status support for HFP AG

Based on HFP specs, the audio connection is independent of the active
call status, which should be managed by the ModemManager part of the
plugin.
But when using HFP AG without modem attached, e.g. during zoom meeting,
the connection will be closed after a while unless call status has been
forced to active,
cf. https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1744.

Currently and for HFP AG PTS tests requesting to get an audio connection
in 3 seconds after a call activates, this prevent to start audio
connection before starting a call.

This commit prevents to force the call status during audio (dis)connection
if a modem is available.
This commit is contained in:
Frédéric Danis 2025-11-19 15:59:57 +01:00 committed by Wim Taymans
parent b940d9f3a1
commit f9f08f7f5c

View file

@ -2759,7 +2759,8 @@ static int sco_acquire_cb(void *data, bool optional)
goto fail; goto fail;
#ifdef HAVE_BLUEZ_5_BACKEND_HFP_NATIVE #ifdef HAVE_BLUEZ_5_BACKEND_HFP_NATIVE
rfcomm_hfp_ag_set_cind(td->rfcomm, true); if (!mm_is_available(backend->modemmanager))
rfcomm_hfp_ag_set_cind(td->rfcomm, true);
#endif #endif
t->fd = sock; t->fd = sock;
@ -2813,7 +2814,8 @@ static int sco_release_cb(void *data)
spa_bt_transport_set_state(t, SPA_BT_TRANSPORT_STATE_IDLE); spa_bt_transport_set_state(t, SPA_BT_TRANSPORT_STATE_IDLE);
#ifdef HAVE_BLUEZ_5_BACKEND_HFP_NATIVE #ifdef HAVE_BLUEZ_5_BACKEND_HFP_NATIVE
rfcomm_hfp_ag_set_cind(td->rfcomm, false); if (!mm_is_available(backend->modemmanager))
rfcomm_hfp_ag_set_cind(td->rfcomm, false);
#endif #endif
sco_destroy_cb(t); sco_destroy_cb(t);