diff mbox series

[BlueZ,1/2] profiles/audio: asha: Reset state on disconnect

Message ID 20250422054547.132400-2-sanchayan@asymptotic.io
State New
Headers show
Series Fixes for re-connection issues with ASHA profile | expand

Commit Message

Sanchayan Maity April 22, 2025, 5:45 a.m. UTC
This fixes the issue of an ASHA device failing to re-connect after
getting disconnected since `asha->state` was not set to STOPPED on
a disconnect.
---
 profiles/audio/asha.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/profiles/audio/asha.c b/profiles/audio/asha.c
index 10115b92d..df283dd22 100644
--- a/profiles/audio/asha.c
+++ b/profiles/audio/asha.c
@@ -478,20 +478,21 @@  static int asha_source_disconnect(struct btd_service *service)
 	DBG("Disconnecting ASHA on %s", addr);
 
 	if (!asha_dev) {
 		/* Can this actually happen? */
 		DBG("Not handlihng ASHA profile");
 		return -1;
 	}
 
 	asha_source_endpoint_unregister(asha_dev);
 	bt_asha_reset(asha_dev->asha);
+	bt_asha_state_reset(asha_dev->asha);
 
 	btd_service_disconnecting_complete(service, 0);
 
 	return 0;
 }
 
 static struct btd_profile asha_source_profile = {
 	.name		= "asha-source",
 	.priority	= BTD_PROFILE_PRIORITY_MEDIUM,
 	.remote_uuid	= ASHA_PROFILE_UUID,